What's so important about the h4 square in this endgame? I'm reading John Nunn's book Grandmaster Chess Move by Move, and it stresses the importance of the h4 square in the following endgame.

8/2p2p2/5k1p/2B1p1p1/4P3/1P3P2/2n1K1PP/8 w - - 0 1

1. Kd2? Nd4 2. Bxd4 exd4 3. b4 Ke5 4. Kd3 h5! 5. g3 h4


Nunn writes,


  and [Black] is just in time to prevent h4 by White. Now White cannot make progress and the game is drawn.


Using computer analysis, I see that the move 6. Kc4 loses in the resulting position, due to 6... hxg3 7. hxg3 g4! So white's best attempt is not Kc4 but rather playing f4 at the right time.

Why is it advantageous for each side to occupy h4? I have some thoughts on the matter but would appreciate a more complete answer.

Thoughts:


If white occupies h4, he can exchange hxg5 hxg5 at the right time and liquidate the kingside, so that black can't queen with an h-pawn. This is especially important since white's plan is to push f4, capture the d4 pawn and then attack on the queenside. Better not to leave behind a black h-pawn that can queen.
If black occupies h4, then he has an advanced h-pawn that can
potentially queen, especially if white tries to break through with
f4. (In the case of f4, black can counterattack on the kingside.)


Compare the above (drawn) position with the position below which is won for white. The moves are given by Stockfish. I think this illustrates why exchanging h-pawns is advantageous for white, so that he can attack on the queenside more freely.

8/2p2p2/7p/4k1p1/1P1pP2P/3K1PP1/8/8 w - - 0 1

1. hxg5 hxg5 2. b5 f6 3. f4+ Ke6 4. Kxd4 Kd6 5. e5+ fxe5+ 6. fxe5+ Ke6 7. Kc5 Kxe5 8. Kc6 Ke4 9. Kxc7 Kf3 10. b6 Kxg3 11. b7 Kf2 12. b8=Q g4 13. Kc6 Kg2 14. Kd5 g3 15. Qf8 Kh2 16. Ke4 g2 17. Qf4+ Kg1


What are your thoughts on the endgame? Why do you think the h4 square is important for both sides? Am I leaving something out in my analysis?
Your thoughts are correct.

In pawn endgames with play on both wings, it is often decisive for one side to be able to reduce his pawn majority to a 1 vs 0 situation ; reversively, he wants to ensure he keeps a pawn on the side where he has a pawn minority. 

The idea is that the opponent king will be diverted by your eventual passer and take it (thus opening space for your breakthrough or counterplay on the other wing). If you have reduced your majority to a 1 vs 0 situation, there is nothing more for the opponent king to do. Otherwise, it would remain active and grab enough of your pawns on this wing to get a passer of his own.

I am familiar with this concept thanks to an excellent book by Glenn Flear. I haven't seen it in print anywhere else.

That's exactly what happens in your example. White gets a 4 vs 3 majority on the kingside. If he can reduce it by exchanging the h-pawns, he will sac his eventual extra f-pawn to distract the Black king and win on the other side (take Pc7, queen b-pawn).

However, if Black can retain the h-pawns (and if they are not too far north), the black king will be able, after taking the f-pawn, to also collect white h-pawn, and threaten to queen his own h-pawn.

That's why White needs to exchange the h-pawns early (or to ensure they stay far enough up the board for Black's counterplay to be too slow) with h2-h4 and hxg5.

See comments in this line:

8/2p2p2/7p/4k1p1/1P1pP2P/3K1PP1/8/8 w - - 0 1

1. hxg5 hxg5 2. b5 f6 3. f4+ gxf4 (3...Ke6 {loses trivially}) 4.gxf4 Kf4 5.Kd4 {Thanks to zugzwang, White can also exchange the 4 and f6, even if that's not necessary here} Kf3 6.e5 fxe5 7.Kxe5 {And the White King wins Pc7 and the game, while the Black King has nothing to attack anymore and is just out-of-play. Add wPh2/bPh4 and the evaluation changes !}