Thank you for playing.
The AI calculates all possible moves and then uses a simple score system to pick the best move available. Stuff like putting the enemy king in check, capturing high ranking pieces or protecting it's own king have higher scores. It also has some randomness so it does not make the same moves everytime.