I think it depends on the school. My children are genuinely happy at their school, as are the vast majority of their friends. However, it’s independent.
One of the things which attracted us to the school was the fact that the children looked happy and engaged walking between lessons. They walk with a sense of purpose. Many other schools I see have pupils who are walking with slumped shoulders and dragging their feet.
They have a strict uniform (with blazers and jackets, and boys have ties). Many of the buildings are old and not new and shiny, and aren’t necessarily an ideal temperature. They have very long days, and go to school on Saturdays. None of those things seem to impact happiness.
The differences I see is that teachers and pupils, on the whole, respect each other. Bad behaviour and bullying simply aren’t tolerated. Both of these things are dealt with swiftly and effectively. Pupils do a wide range of subjects, including many extra curricular things. That means children get to find the things they like and enjoy. They have large range of subjects to choose from. Another big different is sport. They do lots more than other schools (3 afternoons a week, plus extra curricular of their choice). As they get older, they can choose which sport they do, so aren’t forced to do something they dislike. The mobile phone policy is very strict; one of the strictest I know. They aren’t allowed to take smartphones to school until 6th form (and brick phones should be handed in). Whilst I’m sure there’s some bending of those rules, the strict policy means that pupils aren’t generally able to use their phones during the day. It means pupils have to engage with each other.
In short, I think the most important things to improve happiness would be zero tolerance of bad behaviour and bullying, very strict phone policies, and a wide range of subjects and sports which means pupils can find their strengths and do things they enjoy.