Take a very simple game like pong. The way the game works is to have variables that store the position of the two paddles, position of the ball, and the direction and speed the ball is going.
Every time the screen is redrawn, it checks to see if there’s user input to move the paddles, and if so updates their location, and updates the position coordinates of the ball depending on its speed and direction. It then draws everything on the screen.
Therefore to save the game, all it needs to do is store the contents of these variables somewhere. By restoring this information, it can draw everything exactly as it was when the game was saved.
For more modern games, it’s really just the amount of this “state” data that has increased.
Latest Answers