Initially it was suggested that certain people were born with a fear of things like height or loud noises, but I think there are more feasible explanations:
One suggestion is that it is through conditioning: Learning to be afraid through traumatic experiences such as falling off a chair as a baby.
My belief is that most mammals have a fear of falling to some extent, it's a natural instinct that helps us survive.
However, that instinct might become heightened or relaxed in individuals due to influencing factors such as vision, balance or confidence.
For example, we rely on our vision to keep us balanced and coordinated walking on the ground. As we go higher and higher, visual cues become less reliable, and we begin to naturally rely on other cues from our body (insert the words "proprioceptive" or "vestibular" into a search engine and you should see what I mean).
Some people struggle to interpret these cues, or still rely on visual support. As they go up further from the ground, their brain needs to work harder to interpret all the visual signals going around and this causes confusion and panic.
Imagine standing at the top of a skyscraper.
For someone that is relying on visual cues to understand where they are positioned and how they should be moving to remain safe, you can see how visual data might overload their system causing panic and fear.