I have thought a lot about this question over my career both as an employee and as a manager wondering how to make the environment better.
One of the conclusions I've come to is that the group dynamic is unique to the individuals in the group. This means that people who get along with each other have a better experience at work than those who don't (which is kind of obvious) except that the mix is important too.
When I first started hiring I focused on the technical requirements of the role and experienced hiring people who were incompatible with other members of the team. And I have also experienced people who just made everyone else on the team more functional. Sometimes it is obvious, people who are blatantly prejudiced or misogynistic, sometimes it is more a subtle introverts and extroverts.
But when you get it right and people get along well, and the problem is an interesting one, and everyone feels like they are contributing in a way that is both valued and part of the bigger plan, they respond very favorably on surveys about great places to work.
As an employee I look for checks on antagonistic behavior of peers, and enough transparency so that I understand what is important and what isn't. And of course a level of autonomy and delegation that is appropriate for my experience level. Nothing really crimps my style like a manager telling me how to do my job every day.
I've known employees however for whom what is important is simply the quantity of office 'perks.' Free stuff like food, t-shirts, and field trips. They do enough work to not get fired but not much more, and they really don't take anything outside the office (as soon as they leave the building they forget any and all work efforts, or at least put them out of their mind).
Bottom line, a good place to work is where you get along with the people you are working with and share respect. Pretty much everything else is noise.