There is only one company and the amount of dividend payment is taken from the pot (Retained Earnings). All that matters is the picture of the balance sheet at a determined date. The Income Statement is just the Results of Operations in a period. Don't you see that there needs to be accumulated earnings in the company, in order to allow its distribution to the shareholders? If a company borrows money to pay a dividend, is related to the cash position of the company. It may sell a building as well.