"What role, if any, does caffeine play in training? There are many different forms, from black coffee to N.O. Xplode to jelly beans. If the drug is useful, surely some forms of it are more useful than others."
Useful, perhaps. But not in the gym. And not consistently as an ergogenic aid. If it's the caffeine you want then get it without the ride-along crap that's in any supplement you can buy at a shop in the mall. It is more useful in the context of endurance performance. If you find yourself needing it to get jacked-up before a workout then getting more sleep will be far more beneficial than taking the supplement.
Caffeine is an effective stimulant. It causes the pituitary gland to release a hormone that tells the adrenal gland to produce adrenalin, which makes the heat rate and blood pressure rise, and sugar is released into the bloodstream to prepare the individual for action. Due to its stimulant effect caffeine can improve performance during brief intense effort (any stimulant can modify one’s perception of effort).
Caffeine is a genuine ergogenic aid: 3-10mg per kilogram of bodyweight prolongs time to exhaustion, increases free fatty acid supply to the muscles, which spares muscle glycogen, delaying fatigue, reduces perceived exertion, stimulates the nervous system, etc.
However, caffeine remains in the blood for 6-10 hours, which can affect sleep and recovery. Frequent caffeine intake causes the body to “run hot” all of the time and there is a cost. The caffeine receptors in your body to habituate to the drug, meaning you eventually need more caffeine to feel a similar effect. Discontinuing the use of caffeine for 10-14 days cleans out these receptors and increases their sensitivity.
In certain situations caffeine and other OTC stimulants can be quite useful. A friend is tight with some pro cyclists, one of whom won a sprint in a big grand tour recently. He was about to pack it in at one of the feed zones because he didn't feel sharp, or have adequate desire to close escrow at the finish. A 400mg hit of caffeine changed his outlook and he took it strong to the line. I've had similar experiences in the mountains where the caffeine not only reduced perceived exertion but modified my perception of risk as well: I wasn't bulletproof but the feeling of confidence changed my fear from something that kept me from moving with certainty to something that merely kept me attentive, with just enough edge to improve performance.
An unforeseen benefit is that glycogen replenishment is improved in the presence of caffeine. The science isn't clear so it's not known how much is needed but a little caffeine during the recovery window (along with requisite carbs of course) may speed recovery.
Used wisely, caffeine is wonderful. Used indiscriminately, caffeine can be dangerous (negative effect on recovery, adrenal exhaustion, etc), and eventually becomes less effective.