Yeah, sleep is a HUGE part of it, and eating. If you haven't eaten enough during the day or not had enough sleep you'll generally not be able to put as much effort into a workout. You need to give your body fuel, otherwise it won't run. For example, on Tuesday I had a good nights sleep (around 8-9 hours) had been eating every 2-3 hours through the day and I managed to run 5km in 23 minutes. Today, I did the 5km run in 34 minutes and felt horrible through most of it, I only got 6-7 hours sleep last night and wasn't able to eat/drink regularly because of assignments/classes.