With the attacking king close, the queen's checks and the king's attack on the pawns coordinate, and the pawns fall or the king is mated.
Move the white king from h7 to f4 and the previous draw becomes a quick win. Now the queen check from h2 (Qh2+) drives the black king off the second rank or into a mating net, and the white king attacks the pawns directly: after Kd1 or Kf1 the king on f4 takes e3, after which the second pawn is also lost.