In a learning environment, a common cause of boredom is lack of understanding; for instance, if one is not following or connecting to the material in a class or lecture, it will usually seem boring. However, the opposite can also be true; something that is too easily understood, simple or transparent, can also be boring. Boredom is often inversely related to learning, and in school it may be a sign that a student is not challenged enough, or too challenged. An activity that is predictable to the students is likely to bore them.[31]

"If this is one of your tricks..." Like the time Torin had ordered hundreds of blow-up dolls and placed them throughout the fortress, all because Paris had foolishly complained about the lack of female companionship in town. The plastic "ladies" had stared our from every corner, their wide eyes and let-me-suck-you mouths taunting everyone who passed them.
There are three types of boredom, all of which involve problems of engagement of attention. These include times when we are prevented from engaging in wanted activity, when we are forced to engage in unwanted activity, or when we are simply unable for some other reason to maintain engagement in an activity.[13] Boredom proneness is a tendency to experience boredom of all types. This is typically assessed by the Boredom Proneness Scale.[14] Recent research has found that boredom proneness is clearly and consistently associated with failures of attention.[15] Boredom and its proneness are both theoretically and empirically linked to depression and similar symptoms.[16][17][18] Nonetheless, boredom proneness has been found to be as strongly correlated with attentional lapses as with depression.[16] Although boredom is often viewed as a trivial and mild irritant, proneness to boredom has been linked to a very diverse range of possible psychological, physical, educational, and social problems.[19]
Then, after a baseline EEG test measuring normal brain activity, the researchers assigned the participants a tedious task: they had to turn eight virtual pegs on a screen as the computer highlighted them. This activity lasted approximately 10 minutes, during which time the researchers used EEG caps to measure participants’ brain activity as they carried out the boring task.
This example leads to another key aspect of boredom. As Eastwood, Frischen, Fenske, and Smilek point out, bored people become aware of their difficulty concentrating. As a result, bored people often try to amuse themselves by daydreaming and letting their mind wander. Interestingly, while mind wandering helps people to keep their minds occupied, studies suggest that the more your mind wanders, the more bored you feel. The idea is that you recognize that this daydreaming is meant to occupy your mind, and so you realize that the situation is boring.
Martin Heidegger wrote about boredom in two texts available in English, in the 1929/30 semester lecture course The Fundamental Concepts of Metaphysics, and again in the essay What is Metaphysics? published in the same year. In the lecture, Heidegger included about 100 pages on boredom, probably the most extensive philosophical treatment ever of the subject. He focused on waiting at railway stations in particular as a major context of boredom.[25] Søren Kierkegaard remarks in Either/Or that "patience cannot be depicted" visually, since there is a sense that any immediate moment of life may be fundamentally tedious.
One more key element of boredom is control. Boredom often occurs when you have little control over your situation. Waiting rooms, lectures, and airline gates are all places where you have little control over your situation. Normally, we react to unpleasant situations by changing the situation. If you don’t like a book you are reading, for example, you close it and do something else. Boredom happens when you are unable to change the situation.  
Flow is a state of total immersion in a task that is challenging yet closely matched to one’s abilities, akin to “being in the zone.” Flow occurs when a person’s skills match the level of challenge presented by the environment and when a task includes clear goals and immediate feedback. Tasks that are too easy are boring. In contrast, tasks that people perceive to be too difficult lead to anxiety.