“People don’t quit bad jobs, they quit bad bosses,” according to an old saw. Our research suggests there’s truth behind this saying: bosses matter far more for employee job satisfaction than any other factor we measured. But what makes someone a great boss?

Studies of leaders often focus on their style or charisma, but we wanted to look at how workers are affected by their boss’s technical competence. That is, is the boss is a real expert in the core business of the organization? How much expertise does he or she have? Boss competence is, admittedly, a multifaceted concept. Hence we measured it in three different ways:

Whether the supervisor could, if necessary, do the employee’s job.

Whether the supervisor worked his or her way up inside the company.

The supervisor’s level of technical competence as assessed by a worker.

Using these three measures of supervisor competence, we found that employees are far happier when they are led by people with deep expertise in the core activity of the business. This suggests that received wisdom about what makes a good boss may need some rethinking. It’s not uncommon to hear people assert that it’s a bad idea to promote an engineer to lead other engineers, or an editor to lead other editors. A good manager doesn’t need technical expertise, this argument goes, but rather, a mix of qualities like charisma, organizational skills, and emotional intelligence. Those qualities do matter, but what our research suggests is that the oft-overlooked quality of having technical expertise also matters enormously.

Research into the topic of expert leadership is recent but burgeoning. Modern evidence demonstrates, for example, that hospitals may do better if led by doctors rather than by general managers, that U.S. basketball teams do better when led by a former All Star basketball player, that Formula One racing teams do better if led by successful former racing drivers, and that universities do better when led by top researchers rather than talented administrators.

In our project, we studied 35,000 randomly selected employees and workplaces. The samples are from both the U.S. and Britain. We use traditional ways of measuring the job satisfaction of employees, like the survey question we asked in the U.S.: “How do you feel about the job you have now?” 1 = “dislike very much”, 2 = “dislike somewhat”, 3 = “like fairly well”, 4 = “like very much”. People’s answer on average was 3.2. In Britain, we asked: “Please answer on a 7-point scale from “I am completely satisfied with my job,….I am completely dissatisfied with my job.” We found the answer in Britain was, on average, approximately 5.3. Overall, these ratings seem to us to be good, but perhaps not great, news. Workers are fairly happy.

When we look closely at the data, a striking pattern emerges. The benefit of having a highly competent boss is easily the largest positive influence on a typical worker’s level of job satisfaction. Even we were surprised by the size of the measured effect. For instance, among American workers, having a technically competent boss is considerably more important for employee job satisfaction than their salary (even when pay is really high).

Although we found that many factors can matter for happiness at work – type of occupation, level of education, tenure, and industry are also significant, for instance – they don’t even come close to mattering as much as the boss’s technical competence. Moreover, we saw that when employees stayed in the same job but got a new boss, if the new boss was technically competent, the employees’ job satisfaction subsequently rose.

The bottom line is that employees are happiest when the boss knows what she or he is talking about, and that drives performance: there is growing evidence, from randomized trials done under laboratory conditions, that when you make workers happier they become more productive. One study found that quite small boosts in happiness went on to produce a reliable 12% extra in labor productivity. Moreover, employees who are happy at work are less prone to quit, and it is well known that a high level of quits is expensive for a company. Lastly, it has recently been demonstrated that firms with happy employees go on to have better stock-price growth in the future.

The boss casts a very long shadow. Your job satisfaction is profoundly molded by your boss’s competence; and your own team’s job satisfaction levels depend on your competence.