This is covered under 4.6 and 4.7 of the Immigration Rules
V 4.6 Permitted activities must not amount to the applicant taking employment, or doing work which amounts to them filling a role or providing short-term cover for a role within a UK based organisation. In addition, where the applicant is already paid and employed outside of the UK, they must remain so. Payment may only be allowed in specific circumstances set out in V 4.7.
V4.7 relates to not receiving payment from a UK source for any activities undertaken in the UK, with a few specific exceptions that don’t apply to the question posted.
See also the section on the UK in this question Where can I travel for prolonged periods of time while legally working remotely for a company in my home country?
Edit: Visit guidance published in Jan 2024 states that some remote working for an overseas employer (emphasis added) is allowed, such as responding to emails/phone calls, participating in online meetings. The primary purpose of visiting the UK must be a permitted activity, such as attending meetings. Visitors are not allowed to support themselves while in the UK by working remotely.