With a bishop pawn on the seventh the defending king steps into the corner next to the pawn; if the queen captures the pawn, it is stalemate. The attacker cannot gain the tempo to approach.
The second drawn case. Black's pawn is on c2 and the king on b1. The queen can force the king in front of the pawn as usual, but the critical difference is the corner: when the black king stands on a1 and White's queen takes on c2, Black is stalemated.