Overly simplified, there are 2 ways:
a. upscale (AI driven nowadays). this works well with animation (simple animation Cartoon Network style). less so with movies with digital effects or old movies with lots of picture grain. it's also done natively by the CPU in your smart TV. that's how you can watch a DVD on a 4k screen with good results.
b. a new scan and cleanup of the original film (like the film reel they used when shooting the movie). that's called a remaster and can go up to 4k for very old movies if done well ($$$). this is impossible to do if the original was done in digital, or kept in archives on say VHS tapes (NTSC is the worst option here).

A more thorough read, based on the example of a popular show:
https://treknews.net/2017/02/02/why-...own%20anywhere.