Well, it's like this: you know how a straw works when you're sipping through it and drinking your favorite soda? Everyone thinks they are sucking the liquid up through the straw, but that's not it at all. What happens is you remove the little bit of air that exists in the straw, making the air pressure much less. The normal air pressure outside the straw, which is pushing down on everything, including the soda in your cup, pushes the soda up the straw and into your mouth.
The aerosol spray can works in a similar fashion, except, the difference in the air pressure is reversed. There is a little room in the can for air, or a gas, and that air or gas is increased, so it is under pressure. So you have greater air pressure inside the can, pushing against normal air pressure outside the can. There is another straw, which extends from the spray nozzle all the way down into the inside of the aerosol can, into the liquid to be sprayed. The higher air pressure pushes on the liquid inside the can and pushes it up into the straw, until it sprays out the spray nozzle on top of the can.
All because of a little difference in air pressure. Pretty cool, huh?