Paying a dividend costs the company and as such will decrease the value of the company and the stock.
If all other factors are equal, a buyer would prefer a stock that is expected to pay the higher dividend. If Company A is expected to pay $10 per share annually and Company B $8, an investor who wants to make 8% would be willing to bid $125 for a share of Company A but only $100 for Company B. On the date that a dividend is effective, a company's stock will drop by the amount of the dividend because that amount will be paid to the person who owned the stock at the beginning of that day.