The engine is controlled by the computer, not your foot.
Your foot electronically controls a valve in the intake system, aka throttle. So your foot is really giving the engine more or less air dependent upon the position of your foot.
The computer measures the amount of air entering the engine, and dispenses the proper amount of fuel for that amount of air. Hence the "gas" pedal on the floor opens the throttle, the computer adds more fuel, the extra fuel provides more power, engine rpms increase along with power output, resulting in acceleration and more speed.
Now air changes depending on a number of factors: altitude, temperature, pressure, and humidity. Change any of them and it changes how densely packed the air molecules are for a given volume of air. Now when I say volume of air, I'm talking about the amount of air in a given space like the intake manifold of your truck, or a balloon.
Take the balloon as an example, if you fill it at sea level and then drive 5000ft up a mountain (roughly Denver), the balloon will get bigger and maybe burst. Why? Because the pressure around the balloon is less the higher you go. The pressure in the balloon will try to equalize with the pressure outside of the balloon. Less pressure means the molecules of air are spaced further apart, taking up more volume. Hence the balloon will get bigger, possibly burst. If you fill the balloon in Denver and go down to the beach, the balloon would be limp and deflated at the beach because the molecules have gotten closer together.
That covers altitude, but it's not just that easy.
Warmer temperatures cause the molecules to expand as well, and cold temperatures to contract.
Ever think the H & L on the weather maps? Those are areas of high and low pressure. The higher the pressure, the closer the molecules, the smaller the balloon. The opposite applies for low, further spaced molecules, and larger balloon.
Humidity is a funny one. Think about how much air can fit into that balloon, and displace some of that with water vapor (steam). Because you've added vaporized water, there is now less air. But humidity inside the balloon doesn't change when the balloon travels. If you were to fill two different balloons with the exact same number of molecules of air on days with different humidity, the balloon filled on the higher humidity day would be bigger than the lower humidity day.
How does this apply to your "gas" pedal? You went up more than 5000ft in altitude, meaning less atmospheric pressure and less air for a given throttle setting. Less air = less fuel = less power.
Keep in mind when you go up in altitude you usually go down in temperature, so you regain some power. Although this doesn't help you if you leave the coast in the cooler morning and head up the mountain as temperatures rise as well.
Typically air at altitude is drier (less humid) than air at sea level, again a gain. But neither of these can regain the loss in pressure from altitude. Hence you will have to depress your "gas" pedal more in order to feed the engine the same amount of air for a lower throttle setting you typically use at a lower altitude.
How can you combat this? Simple, make the air more dense!
Turbo/Super-chargers use spinning blades to force more air into the intake manifold, increasing pressure and density.
Ram air scoops gather air at speed instead of from a sheltered location, increasing pressure and density. Think about sticking your hand out the window of a stopped car, no force pushing it back. Put your hand out again at 50mph, it gets pushed back. Most ram air scoops are also cold air intakes.
Cold air intakes gather air from outside of the hot engine bay, using the cooler more dense air. Because you can gather cold air from inside of your fender and out of the slipstream of the vehicle, not all cold air intakes are ram air scoops. Now don't you wish the Trail Edition hood scoops were functional, providing a cold ram air intake?!
I didn't mention much about speed of the air going through the manifold, but I'm going to touch on it. Basically the slower the air moving into the manifold, the less the pressure. So things like air filters, bends and corrugation in the tubing can slow down the air flow, decreasing pressure. In no way to I advocate running without an air filter, but this is why K&N (and similar) have better performance and power than those cheap FRAM things in Walmart. The K&N have a higher flow rate, meaning more air through the filter in a given amount of time.
I hope this helps.