The exact mechanism(s) by which caffeine helps performance is not clear, though traditionally it was considered that caffeine increased fat oxidation. Caffeine consumption stimulates lipolysis, as does exercise, both of which provide more "fuel" for the muscles to burn.
Another mechanism may be that caffeine blocks the perception of fatigue and results in a lower rate of perceived exertion to the athlete. Here caffeine works by stimulating the Central Nervous System, acting antagonistically on adenosine receptors and thereby sustaining forceful muscle contractions. This mechanism would explain how caffeine helps anaerobic exercise.
In discussing the research it is important to remember that “coffee” does not mean the same thing as caffeine. Coffee contains many other biologically active compounds besides caffeine, some of which block the action of caffeine. The majority of studies on the ergogenic properties of caffeine provide that caffeine in capsule, not as a cup of coffee.
A 2008 research project utilized an endurance treadmill test where participants were given a placebo, decaffeinated coffee, caffeinated coffee, or alkaloid caffeine via capsule. Those who ingested the alkaloid caffeine -- but not caffeinated coffee -- had a 31% increase in endurance.