The AI searches a game tree, evaluating the final board value for a given set of moves after a certain depth. The highest board value is returned, and the corresponding move is selected.