The fact that a happy workplace is a more productive workplace has been known since the advent of industrialisation. The most famous early experiments on how to improve workplace sentiment and hence productivity of workers took place in the late 1920s and early 1930s at Western Electric's factory in Hawthorne in the US. It was conducted under the supervision of a sociologist named Elton Mayo. He used two groups of workers from the factory - one as the control group and the other on which the experimentation was conducted. The experiments focussed on changes in working conditions and environment - by changing the lighting at the workplace, tinkering with work hours, etc.
At the end of the Hawthorne experiments, Mayo had come to certain conclusions. Among other things, he felt that it was not the actual working conditions that mattered as the worker's perception that someone was interested in their wellbeing and the fact that they were participants in a decision. Mayo also found that workers were in general more motivated about the improvement in the group's working conditions than just individual needs. In general, group dynamics had a huge effect on productivity.
Henry Ford's innovation of the moving assembly line is well known. Less discussed are his other efforts to improve productivity and reduce attrition in the workplace. He doubled daily wages (workers were getting $2.25 a day in other factories, Ford started paying his workers $5 a day), reduced working hours per shift from 9 to 8, and said that no worker would be sacked unless he/she proved to be unfaithful or completely inefficient. These steps might seem commonplace and obvious for any organisation, but it was a huge innovation in Ford's era. He was not being altruistic - he was a hard-nosed businessman who had figured out that the cost of replacing a worker who had been trained far outweighed the increased salary bill if his moving assembly line was to work properly. After those changes, attrition dropped sharply and production of Model T cars shot up.
Those were historical experiments, but since then HR researchers and managers have constantly worked on improving the workplace. Relatively higher salaries compared to peer companies, better working conditions, opportunity for improving personal skills, open and collaborative workplaces, flexi-time, work-life balance and other such issues have been debated and implemented.
In different parts of the world, different things have taken priority. In Europe, for instance, shorter working hours, and therefore more opportunities for work-life balance, has been very important. In the US and in India, limiting working hours has not been as much of a focus as growth opportunities, higher salaries and opportunities. Also, work from home and flexitime, along with workplace diversity and a professional and fair atmosphere at work has been considered very important by enlightened companies. Those are also what employees value the most, shows the BT-PeopleStrong survey of Best Companies to Work for.