Mate in one
Checkmate means the king is in check and no legal move answers it. He cannot take the checking piece, block the line, or step to a safe square. The game ends. The king is not captured.
Kings on the edge have fewer squares, which is why short mates so often happen on the back rank or in a corner. A checking piece that your opponent can simply take is not mate unless that piece is defended.
Queen on the last rank
The pawns on g7 and h7 take two of the king's squares. The queen on e8 covers g8 and checks along the eighth rank.
Queen protected by the king
Qa7 is next to the black king, and the white king on b6 defends the queen. The king cannot take it, and b8 and b7 are covered.
Rook on the last rank
The black pawns block g7 and h7. Re8 checks, and g8 is covered by the rook. The king cannot reach the rook.