I think you already gave most of the important points in the OP. If Black doesn't try to cage White king the Q-ending is prosaically lost: 1.Kf7 a5 2.Kg7 a4? 3.Kxh7 a3 4.Kxg6 a2 5.h7 a1Q 6.h8Q+ when White can even win a third extra pawn (but doesn't need to by any mean, Qe5 and running the d- and h- pawns is simpler). After 1.Kf7 a5 2.Kg7 Ke7!/Ke8! 3.Kxh7 Kf7! White needs to free their king to avoid losing, so 4.d5 is mandatory. Further, after 4...a4 5.d6, 5...Ke6? would lose a whole tempo (White save one move with the d-pawn) and lose to 6.Kxg6 (or 6.Kg8) a3 7.h7 a2 8.h8Q a1Q 9.Qxa1. So 5...a3 6.d7. Now 6...a2? 6.d8Q a1Q 7.Qg8 (not the only winning move, but the simplest) Ke7 8.Qg7 exchanges queens and wins by getting a new one, so 6...Ke7 is forced. 7.d8Q? would give the pawn for no particular gain, so White wants to free the way for the h-pawn. Since both 7.Kxg6?? a2 8.h7 a1Q 9.h8Q Qxh8 and 7.Kg7?? a2 8.h7 a1Q+ (check!) lose, 7.Kg8! is the only option. Both sides race to queen: 7...a2 8.h7 a1Q 9.h8Q and now: You give '!?' to 9...Kxd7 but 10.Qxa1 is a direct refutation. Most pawns endgames are lost because White captures g6, e.g. 9...Qxh8 10.Kxh8 Kxd7 (Black could only be saved if their king was on f8 here - btw with a wPg5 instead of the wPh6 there wouldn't be any square to save them) 11.Kg7 Ke7 12.Kxg6 Kf8 13.Kxf5. 9...Qa2+ is the only check, allowing to capture d7 while postponing the queen exchange. But as you noticed, White will force the winning pawn endgame anyway after 10.Kh7! Kxd7 11.Qg7+! with either an exchange on g8 or a checking capture on g6.