What the solver does
BoardSolve runs a complete minimax search from the current position. Each leaf is scored +1 for an X win, −1 for an O win, and 0 for a draw; interior nodes propagate the best score for the side to move.
Because the full tree is searched without depth cutoff, every suggested move is provably optimal and the engine can label the position as a forced win, forced loss, or draw with best play.
Why it works
Tic-Tac-Toe is a finite, two-player, zero-sum game of perfect information. Zermelo's theorem guarantees that one of the three outcomes (win for X, win for O, draw) is forced from the empty board — and the historical analysis confirms it is a draw.
Alpha-beta pruning is unnecessary here, but the same minimax skeleton scales (with pruning, transposition tables, and heuristics) to Connect Four and Barricade elsewhere on BoardSolve.