Why does a well-inflated basketball bounce higher than a ball with less air? The answer isn't as obvious as it seems.
Spring-loaded
Air molecules are naturally elastic--they don't stick together like water molecules, but rather bounce off each other in the open.
When tightly packed together inside a basketball, air molecules form a highly elastic unit of air. The air inside a basketball is like a tightly coiled spring. The tighter the spring, the more energy it has to bounce back up. Similarly, the more air inside the ball, the harder it pushes back against the ground, springing the ball higher into the air.
Flatlining
The ball's skin, whether rubber or leather, is less springy than the air it contains. When the skin of a basketball hits the ground, it deforms or flattens. This flattening converts the ball's energy into heat--just like how a rubber band gets warm if you quickly stretch it several times. Heat is lost energy and contributes nothing to making the ball bounce.
Logically, then, the more the ball's skin gets pushed in, the more energy is expended on heat. Conversely, the more air inside the ball, the less the ball compresses upon impact. And the less the ball flattens, the more energy there is to make the ball rebound.
Of course, an inflated ball won't keep bouncing with the same force for very long. Each time the ball impacts the ground it loses a bit more energy, until so much of it's energy is spent that it stops bouncing completely.