Let’s conduct a very simple experiment, shall we? I will show you two images. Look at each image and try to gauge your emotional reaction. Don’t just focus on what you are supposed to be feeling, but the actual visceral reaction you have to each image.
Which image gives you a greater emotional response?
First, Image #1
Now, Image #2
For most people, the second image creates a much stronger emotional response than the first. This is not necessarily a rational response. Both situations are (roughly) equally dangerous, however we have built-in circuitry that deals specifically with situations that were likely to occur in our evolutionary past. Only one of these fits the bill. Apparently, this (useful) fear of heights is installed in us while we are quite young (about the same time we develop the depth perception to perceive it). Sadly, I know of no such innate fear of firearms.
Here’s another fun link about our recent ancestry with the other apes [from reddit].