1. There's a lot of risk aversion in corporate culture these days, the cost of a bad hire can be very high and nobody wants to be held responsible. By having multiple rounds - which in turn requires a lot of people involved - responsibility is diluted so if there's a bad hire you can blame the process rather than one manager.
2. It's an endurance test. Someone who can power their way through round after round of interviews, home projects, online tests and so on shows good "work ethic" or at least a genuine interest in the job.
3. Cargo-culting FAANG. If Google or Meta do this, then we should too (even though we're a tiny startup). It's a bit like picking microservices or Kubernetes: there's good use cases, but for a lot of projects they are overkill.
4. Concern about discrimination: companies are scared of showing bias (whether against or for certain ethnic groups, genders etc) and a formal process should in theory be meritocratic than the old days of "let's just have a quick chat and hire based on gut feeling".
There's good reasons here, but it's probably gone to extremes, particularly for positions at smaller companies with corresponding smaller salaries and benefits.