Why can't the black pawn take the queen at h6? Instead the computer makes the king go to g8.
The pawn on g7 performs two vital functions:
- It protects the pawn on f6 from capture by the White knight.
- It indirectly bars the way to g8 to the White rook on g3.
If it captures the queen on h6 (thereby "moving"), it loses both these functions. Then:
- Nxf6+ Kh8
- Rg8 mate.
For White, the checkmate would be well worth a queen, for Black, not.