Closing a company can be due to a myriad of reasons, but most of the time it is either because the company is insolvent, the owner (or owners) are retiring, or the company is being sold to a third party.
Selling a limited company via sale of shares will incur capital gains taxes depending on the original price of the shares when you acquired them. If there is a profit and costs and exemptions aside their is a taxable amount then CGT would be payable. Business assets are normally liable to corporation tax if they are disposed at profit, but that is within the business so depends on how assets are sold.
Closing down a solvent company is split into two circumstances. If the company is being closed down, and the retained profits are over £25,000 then the retained profits in the company would need to be distributed to all shareholders proportionally and then each shareholder would be liable to dividend tax at their marginal rates.
Closing down a solvent company with retained profits below £25,000 means all shareholder will be liable to capital gains tax on the amount they proportionally receive.
In the above two scenarios it would be preferable to figure out the most agreeable and tax-efficient route. Capital gains tax for gains other than property are 10% (basic rate) or 20% (Higher Rate and above). If retained profits can be squeezed down prior to sale to below £25,000 by paying below tax-free threshold salaries and distributing dividends at basic rate then you can get away with paying only a maximum of 20 percent tax of the remaining retained profit.
Capital gains tax on disposal of company shares can further be reduced to 10% or held at 10% (depending on your rate) if you can claim Entrepreneurs' Relief. This can be used if the shares have been held for at least two years prior to the sale, the person is an office holder or employee of the company, and the company was trading prior to sale. Entrepreneurs' Relief is a 'relief' so a claim needs to be made for the 10% equivalent reduction within two years of the share disposal.
If there are more than five shareholders then another way to force a full disposal of company shares and only have to pay capital gains taxes, with all the benefits described above, is to use an MVL where all assets are liquidated and funds distributed to shareholders accordingly. However, this could lead to penalties if the purpose of the MVL is deemed to have been for tax purposes.