When a student lacks attention during any class period (or wherever they are when studying/learning), that student is not efficiently learning the material at hand. Without attention, the information cannot be funneled to the brain's learning center. The figure below illustrates the critical role of attention (and motivation) in the learning process.
Attention leads to learning. In other words, attention is a prerequisite to learning. And there's no way around it! If a student pays little attention in class, very little learning will occur at that time. I estimate that if a student has good attention in class, it is worth 2-3 hours of study out of class. In other words, pay attention in class and it reduces your study time outside of class.
A student cannot pay attention in class if he/she is sleepy or ill. A good night's sleep will allow the student to be at maximum efficiency in the classroom. Sleep and health often go together. A lack of sleep makes a person more susceptible to illness. When a student is ill, focus in class is almost impossible. It is also impossible to chat with a neighbor in class and at the same time pay attention to the instructor (or whomever is speaking).
This idea/notion of paying attention in class is one I see many student fail at. I can't tell you how many inattentive students I see each day-it would take too long for me to report.