This is an example game I had with the computer. I am the letter O and the computer is X.
This is a visual representation of what the minimax algorithm is doing. Here you can see it is seeing all the possible combinations of what it can play, then it sees all the possible moves that its opponent can play, all the way until the game is a draw, win, or loss. The computer then picks the best move based on the predicted outcome.