Boredom is not the enemy -- poor teaching is.
Quiet students in classroom might be completely off the teacher’s task. (They might be watching a video or engaging in a chat with a student in another class.) They are bored and disengaged because they cannot connect the task to a personally fulfilling trajectory.
Excited students might be responding to a mere trick or joke -- or something that happened outside of class. They are giving off the illusion of being engaged, and not bored, but only because they are temporarily entertained.
Disconnected tasks or activities ground learning to a halt. Irrelevant tasks, busywork, or work that could be better handled by a machine encourage students to practice irrelevancy, mindless busyness, and tasks that will be easily replaced by robots.