It's counterintuitive, but scientists agree that drinking coffee before napping will give you a stronger boost of energy than either coffee or napping alone. To understand a coffee nap, you have to understand how caffeine affects you. After it's absorbed through your small intestine and passes into your bloodstream, it crosses into your brain.
There, it fits into receptors that are normally filled by a similarly shaped molecule called adenosine. Adenosine is a byproduct of brain activity, and when it accumulates at high enough levels, it plugs into these receptors and makes you feel tired.
But with the caffeine blocking the receptors, it's unable to do so. Here's the trick of the coffee nap: sleeping naturally clears adenosine from the brain. So if you nap for those 20 minutes, you'll reduce your levels of adenosine just in time for the caffeine to kick in. The caffeine will have less adenosine to compete with, and will thereby be even more effective in making you alert.