Tablebase
A database of perfectly solved endgames, up to seven pieces.
A tablebase holds the exact, perfect result of every position with a small number of pieces (currently up to seven) β win, loss or draw, and the fastest path to it. It is a whole slice of chess completely solved.
How? Computers work backwards. They start from every possible checkmate, then step back one move at a time β 'from here, whatever the loser tries, mate still comes' β until every position is labelled. It's called retrograde analysis, and for the seven-piece set it churned through hundreds of trillions of positions on huge computing clusters, running in the background for years.
Engines plug into these tables to play endgames flawlessly, and you can query them yourself online β feed in a position and get the perfect result and best move instantly.