This question could be discussed for a considerable amount of time and there are many websites devoted to tax. We must stress immediately that we are not accountants. Whilst we have a significant amount of experience with UK companies and UK tax we do not provide qualified advice on tax matters.
In general terms UK companies pay tax on any profit that the company makes. This is paid to the UK tax authority HM Revenue and Customs. This tax is called corporation tax.
You may need to register for VAT if your company is ‘physically’ based in the UK and your sales are approaching the current VAT threshold.
If as a company director or shareholder you draw funds from the business then you will most likely pay taxes in the country that you are resident. If you are based in the UK then you will need to file a self assessment with HMRC to declare your earnings. If you are based outside the UK then you will need to pay your personal taxes locally.
Running a limited company can often reduce your tax bill but it is not a way of avoiding tax. We strongly recommend that all clients forming a UK company seek professional advice on accounting or tax related matters.