There is a lot of metrics more than simply ‘work done’ by a employee which is missed from a work from home situation.
Many of your top employees assist the weaker employees which results in so much more work done than just having a top performer working from home. A 5 minute conversation with a good worker can save hours of unproductive struggle in a poor one.
It also helps with training, its one thing taking a trained workforce remote. It is another all together to train someone who doesn’t know the job on how to do it remotely.
The jobs it works really well for are ones which are more ‘standardized’ across work sites (things like IT or accounting) where you work means less than you being trained.
Jobs it doesn’t work as well for is the ‘specialized’ to your worksite jobs, for example specific bureaucratic jobs (such as many government jobs where you aren’t bringing a skill set with you and practicing it, rather being trained on how insert departments process works and you being trained in it).
They also did a lot of studies during covid on productivity from working from home. The result was a drop in most fields. You can thank those lazy coworkers who ruined it for everyone.