The object of chinese chess is to reduce the opponent to stasis. The game is over when the enemy king is cptured, or there is no legal move. Here the Red General is in dire straits, and Green has already won the game. The coup-de-grace is administered by a rook sacrifice.
The positions show that red is losing, but 'che', the program finds a rook sacrifice to take checkmate quickly.
The red general may not take the rook because black has a cannon behind the king's pawn. The advisor captures the rook. If the general moves then the other rook will deliver checkmate by moving along the rank.