Because there's no other choice for entry/mid-level positions (and some lower end senior ones). Thankfully they are not 5 hours long, that's something I would also avoid.
For instance, in my recent job search for a new grad role, I had to do an OA for every company but Jane Street and Databricks (props to them).
To be clear, i am talking about: you apply, they send you a response (sometimes automated) telling you to do a couple hours of work, and only then will they decide if they want to speak with you.
This a great way to waste one's limited time on a role that might not even be a fit. If they aren't even willing to spend 15 minutes talking to you first, i would encourage everyone, at any level, to bounce. If they are at all serious, they'll speak with you first.
And I'll also highlight: you never know when they are using you for their own goals, like AI training. Or if it's a ghost job. Or if they aren't hiring for your state. Lots of stuff can come up that would make your work null & void.
To prevent burn out, you really have to guard your time. companies can structure things to be highly optimized for them, and very expensive for you.
In this market, I would die for a 5 hour take home over 500 hours of a completely fruitless job search purely for the motivation that results from knowing at least one company did not just throw your application in the trash.