When I started in the early 80s, working at home was never an option—in fact, it took decades to become practical, even though I occasionally could do it under limited circumstances. In my last year working before I retired, I spent the entire Covid year working at home.
I spent most of my career driving to an office, including the nine years leading my two little startups in 1985-1994. Generally, I didn't even consider working at home much of an option, as the technology of the times was insufficient to make it work. However, when the pandemic changed many people's work options, the technology seemed to be ready finally.
If I had to work again today, I wouldn't want to work in an office if I had a choice.
The internet did not practically exist in the first 15 or so years of my career, and networking remotely was limited to modems, way too slow to do much.
For my two little startups (working on Macs) we had no options for a code repository at all, and none of us had a Mac at home, so working in the office was necessary. In the second company (started in late 1987), we worked on Persuasion for its primary author (a competitor to Powerpoint, later published by Aldus) and sent a hard drive with source code back and forth via FedEx every other day, with manual merges on both sides, since my team and that author were in separate states. Doing that is anything but pleasant and very error-prone. One night he called me to debug something at home, and I had no source code or computer, so debugging was a challenge!
After that, we worked on DeltaGraph, for which the publisher was on the West Coast, so we had to do the same FedEx trick with apps and source code. We had no access to email until 1991 or so (sending binary attachments over a modem is no fun). Any discussions were done by flying to California or using a phone. This was about as remote as could be done at the time.
After the publisher and my company went our separate ways, I spent a year in the Bay Area doing some contracting, including working at Apple, all at the office. I finally saw code repositories, but almost everyone also worked at an office.
I worked at a consulting company for several years before the Dot-Com collapse killed that, all at our or a customer's office. We did hire a consultant to help us on one project, and he insisted on working at home, on a mountaintop in Colorado, without much contact. As a result, what he delivered was unusable.
My next job was again for a consulting firm, and here I worked remotely—in Mexico! I flew in every Monday, and every Friday, I flew home; during the week, I crammed into a conference room with 40 other people. I wished I could drive to an office.
My following few jobs generally involved ever-increasing commutes, except for the game company I worked at for more than two years; there I could work at home, having a PC and a Mac in both places, and we only had three programmers. They paid me so little no one complained if I wasn't in the office. One of my jobs was fighting a hacking company that sold a hack for our (MMO, FPS) game, so I worked at home on defeating this to hide my IP address. Additionally, I often needed to debug the game live, solving performance issues (there was no easy way to simulate 100+ people in one place offline). The evening was the busiest time to play, so I just did this at home. However, this was not the same as working full-time remotely.
In my first mobile job, at an Online Travel Agency (today only a brand you would know), I worked in the office, but at the start of a crazy demand from the CEO to write a new app and have it in the App Store in three weeks (it took two months), I worked one weekend at home. Still, it was not remote; we took our laptops home every night anyway but otherwise never used them there.
The job I had while waiting for what would be my last job—it took a year to be approved—after six months as a contractor, I finished all the work they wanted, but the rest of the project was not complete, so they agreed to let me work from home as needed. I didn't do much, so it wasn't really a remote job.
In that last job, I was tasked with high visibility and high-profile projects, and for the first time had to work more than 40 hours a week regularly. Working for a substantial non-tech company, we had the resources to let me connect to our internal network remotely, so while I took my encrypted MacBookPro home every night, access was pretty easy.
The last day I worked in the office was in March 2020; the Android and iOS teams had lunch together, discussing what might happen. That night we were told to no longer come to the office and work at home. At first, it was a little messy as our internal IT support had never planned for everyone to work at home simultaneously, but after a couple of weeks, it got smoother. Of course, our business was dead, and many projects were canceled, which made it OK.
As projects were restarted, our workflow was acceptable, and many of the teams I had to work with were in other time zones anyway, so our Bluejeans (later Zoom) calls were routine anyway. In addition, I had always communicated by Slack with my team, other teams, managers, and even random people who asked me questions all day. This did not change being at home; I only missed having lunch with people daily.
Before the pandemic, when new team members in our Mobile teams started, I usually taught a class on what we did and who everyone was as an introduction. This was harder to do remotely, but I didn't have to do many since we didn't hire many people until I retired. I would have missed having individual contact with new people, given our work was pretty complex, if I had continued.
My former team members and others I still talk with now have to work two days a week in the office, and no one finds it helpful—most of them have to work with people from elsewhere, so where you are, if it's all long-distance, is pointless.
To successfully work remotely, you need the ability to communicate efficiently (such as Slack/Zoom, etc.), interact with your work (source code repository, JIRA, etc.), and interactivity with your employer (IT support, HR, etc.). While it was possible to do this earlier without ever seeing anyone else, it's only recently that all of these were available and reliable.
It is possible to make working remotely as easy or even more accessible than being together in an office. However, building interpersonal relationships with your teammates is much more challenging in remote; I knew everyone I worked with for a long time before we started our remote lives. Building a team that trusts each other, is self-motivating, and understands what is required could be difficult if you never know them for real.
Companies and management would rather have people visible to them, and if they spent a lot of money building office space (like Apple with its Spaceship), they might prefer to have it be utilized. I did not mind going to work for most of my career since there was no real option; however, given my experience in that last year, I would prefer to work at home if I still had to, with occasional in-person meetings, to feel connected. Some people might take advantage of not being in an office and waste time or work multiple jobs, but I saw that happen even earlier in my career in an office. Therefore, I think working in an office is no longer necessary unless there is some reason for secrecy or interaction with hardware.