system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do chess programs simulate playing at different levels?

In other words, how does my chess app know what a novice, intermediate, or advanced player would do at a given point during a match?
gpt
The simple answer is they really don't know what their opponent will do, nor can they predict it.

What the programmer can do, however, is adjust how many moves ahead the computer can "think" and have it select the moves that grant the greatest number of win states. So if you move your Queen forward three spaces, in the few moments of time between you locking in your move, and the computer moving to block your Queen (for example), it has looked at your possible moves that include your obvious "next move equals Checkmate" to you opting to move a random pawn for no reason. It then looks at how it could respond to each and every choice you might make and determined that the move with more "wins" for it involve blocking your Queen.

To put it another way, if you've seen 'Avengers: Infinity War' the Computer basically does the Dr Strange thing and looks at the 14 Billion possible futures, and in only one of them does the computer win, so that's the move it makes.

If the computer is to be virtually unbeatable, it can be permitted to look at every possible variation on the game at hand (of which there is a huge, but still finite number) and stick to moves that equal wins. Alternatively a 'Novice' AI might only be allowed to see one or two moves ahead, or maybe just be forced to move pieces at random.

Of course, with advances in AI technology it's entirely possible to have the Computer "learn" from its opponent and make predictions based on that. However while these exist to a certain degree, the majority of Chess AI that you find online will fall into the above explanation.