AI chess engines assign numerical values to different pieces and calculate material balance, positional factors, and potential threats to determine the best move to make.