In reality, it thins out the workforce by triggering resignations in people who think they're going to have an easy time getting a job elsewhere at a remote-friendly company, which is typically your best people. On the balance sheet it looks great because they're often the top earners, but in reality you're losing some of the best talent you have.
It also thins out the workforce by removing anyone who can't return to the office, or for whom doing so is untenable; people with disabilities or health issues, single parents, and so on, regardless of how well those people perform or what they bring to the company.
Theoretically those positions can then be filled by people who are more talented or more interested in or passionate about the role, but in reality they'll be filled by people who don't mind RTO or who need the job bad enough that they'll put up with it.