I saw good situations in a couple of large companies, but also in some small startups. Private offices or common offices for small teams (2-4 people) with sound barriers to keep things quiet were the best physical environments. My experience with remote work has been uniformly good.
The best psychological environments were ones in which teams developed confidence and trust in each others' capabilities and judgments, and in which leadership was trusted both to make reasonable strategic decisions, and to treat people fairly.
I've also seen a variety of bad situations. Major contributors to loss of productivity include excessive noise and distraction in the workplace, too many interruptions, oppressive micromanagement, loss of trust and confidence among colleagues or in leadership, too much or too little process, anxiety over the solvency of the company, infighting and factionalism, sudden, frequent changes in product objectives and business strategies, loss of leaders' credibility, and sketchy business practices. All of these things impair productivity.