In 2012 a Google recruiter told me the got 1 million applications a year. I'm guessing that number is higher in 2022 and it's similar for other similar companies. You can't give 1 million applicants 5-30 hours of contract work. You still need some process to select a few of them. What would that process be?
Nobody said you needed to give contract work to everyone and their dog, or that it was specifically a great idea if you're big enough to get a million applications (proverbially or literally).
If it's clearly not a good fit then this wouldn't be offered. If you are doubting then this could be a good way to make a decision with the most information you could possibly have, low risk for the company, the applicant gets paid when they might otherwise be between jobs... there are the caveats mentioned in sibling threads, but in some cases, yeah I can see this being a good idea.
We recently rejected someone and I still think that was the right decision, but there is still a chance it wasn't. I wouldn't have minded giving them some contract work to find out if they were competent and just terrible at showing it in an interview. I didn't realise this was even an option. Though in this case it probably wouldn't have worked out due to them currently having a job.