In ancient history, when day to day survival depended on executing a particular pattern consistently (hunting, forced migration to follow herd animals and plants in bloom, etc) boredom would be irrelevant and pattern execution prioritized as an essential survival mechanism. Hunt, sex, move, repeat. Doesn't matter if you hated hunting, moving, or got bored having sex with the miniscule pool of partners available in ancient history - you stopped any of those behaviors and your gene pool died out.
Humans are excellent at recognizing basic patterns and executing them, something that is distributed throughout the animal kingdom. All animals execute patterns repetitively, and when they evolve into larger colonies, the patterns and behavioral repetitions are increased in frequency and expressed in higher percentages by its members; the patterns also become more complex. Working 9 to 5 is the normal distribution pattern for humans because for thousands of years we've been working 9 to 5, or whenever the sun rised or set, repeating the same behaviors over and over. It wasn't till we hit a critical milestone of abundance that humans could specialize and experiment with activities and inventions that had no immediate and direct survival benefit for the individual but in the end provided a net advantage to the group.
And it's no coincidence that behavioral and cognitive outliers were able to work obsessively on inventions that paved the way to our present level of technology and knowledge - we have evolved to trudge through hard tasks for a reward. In light of all this, it seems silly to even ask how people can grind out a 9 to 5 gig as if we're not designed to do so. Look at THF - he hates the 9 to 5 but yet he's doing the 9 to 5. And I bet he'll be doing the 9 to 5 for some time. Even if he quits the 9 to 5, I can guarantee you that he will be repeating a different pattern - the difference is that he will be a prisoner in a cage of his own design. If THF was in the 20% of the pareto distribution, he wouldn't be here asking this question - he would be executing a paradigm shift in his own life.
Look at Elon Musk - that guy is grinding harder than any of us. He may love what he's doing, but he's still grinding. And I'm pretty sure that a large part of that grind is boring and not fun. But yet he can do it because he is wired like the rest of us - he just executes on a larger scale.