Because chess engines weight every move differently based on it’s own rules and depending on the code and constraints, time limits and memory/computer resources available, they usually calculate future moves x steps in advance.
I have watched recently a video by Sebastian Lague, where he ran a chess programming tournament and while most of the stuff about coding it’s out of the scope of an eli5 he goes through many of the entries where he explains the criteria and weighting and how the code chooses future moves.
Latest Answers