It doesn’t. A Company pays Corporation Tax on its profits before dividends are paid out. Consequently, shareholders are treated as having already paid tax on their dividends (called a ‘tax credit’). A shareholder who is paying Higher Rate Tax will have the dividends added to their income and will have extra tax to pay.
The advantage of paying dividends is that compared to salaries you will save on National Insurance. For instance, a bonus paid through salary will suffer Employer’s NI of 13.8% (plus any PAYE and Employees NI due), while there is no NI to pay on a Dividend. This is a major reason for small Company owners choosing to pay themselves small salaries and then receiving their ‘bonus’ in Dividends.