Lesson
White to move. Main line: 1. Qb8#
After 1.Qb8# the queen checks along the back rank. The f7, g7 and h7 pawns block every forward escape, and the queen covers f8 and h8 — so it is checkmate with nothing able to interpose.
The back-rank weakness is one of the most common ways games end. The prophylaxis is simple: make luft — a quiet h3 or g3 — so your own king is never mated behind an unbroken wall of pawns.
A lone rook does the same job whenever the back rank is undefended, which is why the real question is never “is a queen attacking” but “how many defenders does that rank still have”. Count them before you trade off the piece that was quietly guarding it.