Starting Issues

Occasionally, I fail to start the car on the first turn. It will begin to start, and just die, like I didn't hold the key turned long enough. When this happens, I can't start the car for a while. It'll just crank and crank and crank and I never get even hint of it starting. Then I just get out, walk away, and let it sit for about 5 minutes. When I get back, it starts up like normal. If I sit in it and keep trying to start it for 5 minutes, though, it won't start.

I'm not expecting there to be a simple fix for this, but can anyone tell me why this happens?