I misinterprted your post and thought you had player 1 and player 2 reversed. To make a point, the example in the book is a little contrived in that we know both player's cards.
I worked backwards with stove a little to try to understand this trying various ranges for villain. If he calls the preflop 3 bet with the top 4% of hands (99+, AQs+ and AKo), he is a 2:1 dog.
In a real game, I would discount the 6 combos of AA to about 2 (one pair has Ah) because most players 4 bet pre. Therefore his range changes slightly to AcAh, AdAs, KK-99,AQs+,AKo and he is a 3:1 dog.
When the flop comes Qh, 9H, 3h he improves to even. The only made flush in this (arbitrary) range is AhKh. Now, if you shove, I think he folds his AKo, AKs non-heart, pairs without a heart below QQ. This makes him a 1.25:1 favorite.
(AcAh,AcAs,KK,QcQd,QcQs,QdQs,JcJh,JdJh,JhJs,TcTh,TdTh,ThTs,9c9h,9d9h,9h9s,AhKh,AQs)
If instead, you check and he shoves, you must call with your 44% equity, so it is better to shove yourself and take advantage of any fold equity.
All this just drives home the point that a 2.5 SPR and an overpair commits you and a shove is often a good play.
If the flop had been Ah, 9h, 3h is a shove still +ev? His range is different because the Qh is now a Ah. There are fewer AKo and more AQs in his range, but he is now a 1.25:1 favorite with a few ties. Now a shove doesn't work because only the pocket pairs below KK fold leaving you a 10:1 dog.