Some folks thrive in an office environment, they value the things it provides - a schedule, a time, a reason to get up and out, socialising with others, being out in the world. It comes at a cost of time and a bit of freedom; you don't really get to choose the hours or where this happens, neither the folks you interact with.
Others prefer working remotely, they cherish being able to set their own schedule and work, and being able to manage their level of interactions with others. Remote work does not have to be work from home either, and the freedom this gives can be quite liberating.
There is also a somewhat of divide between introverts and extroverts between which they prefer, but of course - there are many in either camp leaning the other way too.
You just have to find what works for you - and that means trying both, or a mix, and seeing which one suits you best.
Where it gets rather frustrating for folks is when they are not given a choice - some companies; ergo leaders, can't wait to have everyone back in an office even after 2 or so years of being (mostly? somewhat?) productive during the pandemic; and this is where frictions arise. Other companies are entirely remote, and for those who thrive in an office environment, they will struggle greatly.
I'd love to see managers / leaders, and even employees recognise that individuals have preferences, and being accommodating of it to get the best out of their people, rather than imposing how they find they work best. How, or what this would entail, I'd have to give more thought - but I believe there are plenty of individuals with far more experience and knowledge than me around this topic who have been successful at managing hybrid (office + remote) teams, and accomodating individuals that lean either way.