Primary purpose trading
A charity can trade. Whether the profits are taxed depends on why it is trading.
Trading that directly furthers the charitable purposes — a theatre selling tickets to its own productions, a training charity charging for courses — is primary purpose trading and its profits are exempt. Trading purely to raise funds is not, though a separate small-scale exemption may cover it.
Where non-primary-purpose trading exceeds the exemption, charities usually use a trading subsidiary. See trading and tax and the small trading exemption.