It's less of a height issue, more of a center of gravity change.
When you raise your bar height, your body's center of gravity shifts rearward. Just like in a car, the magic balance of 50% weight on the front, 50% weight on the rear yields the most predictable and reliable handling, and much of the same goes for riding.
Since you shift your center of gravity rearward with a higher bar height, regardless of why (riser bar, spacers, stem rise, axle-to-crown, headset cups, even tire height), you're putting more weight on your rear wheel than your front. On an uphill climb, this issue is multiplied and thus your front end starts wandering because it barely has any weight on it.
If you lower your bars, the opposite happens. Your COG moves forward, balancing the weight ratio front and rear, and thus your front wheel has traction and yadda yadda.
The opposite holds true for downhill. Raising your bars is beneficial because your COG is shifted rearward. The same reason why you shift your butt behind your seat.. get more traction in the rear, get to the magic 50/50 ratio.
For AM, strike a balance. Then learn to shift to the tip of your seat for climbs, and shift to the rear of your seat or behind to descend.
As far as stuff like stem length:
The longer the stem length, the further your twisting force is from the axis of rotation, aka the steerer. This means it requires more movement on your part to get the front wheel to turn. It gives you more stability and also shifts your weight forward, both which are beneficial for climbing.
The shorter the stem length, the opposite is true. You can twitch your front wheel faster, the rate of movement around the steerer is more rapid, and it shifts your weight rearward. All useful for downhill.