The easiest example of this that can be done by anyone with the most basic photoshop skills is using multiple images of the same scene, and then cut biths out of those images that you want. Note: professional editors of course use many more advanced tools, but the principle remains the same.
A quick and dirty Paint example might help convey the basic idea. I wanted to take a picture of a beautiful park, but I don't want people in these pictures. This is a very busy park so there's never any time where it is empty. I'm not allowed/able to ask people to leave, so what do I do?
I took this picture:
But there's someone on the bench. I don't want that. So I tried again, and took this picture:
That's no good, now he's in front of the tree!
But now I can solve the problem. I open Photoshop, I take the right half of the first picture, the left half of the second picture, and I put them together. This gives me exactly what I want:
You don't really see it, but this image is actually a montage of the two separate images I took:
This is of course tremendously oversimplified, but that is the basic principle at play here: overlaying multiple images and making a "montage" of them so you can hide things from one image using another image.
If you google how to remove people from photographs, you will get a lot of hits for tutorials that predominantly use this approach, whether manual or automated.