As @Colinjb a lot of it is boundaries. If the kids know what they can and can’t get away with and the consequences then most will behave. If they’ve never been set boundaries and know that if they play up they’re not even going to get into trouble they’re going to get reward then why behave? I think back to my school days and my maths teacher had a a reputation of being ridiculously strict, but guess what, no one played up in his class, it was like a military operation walk in in silence, stand until told to sit. Windows open whatever time of year as he believed cold made people pay attention more etc. our history teacher on the other hand was soft as shit and couldn’t control the class at all, same kids completely different behaviours. Sadly the days of discipline seem to be long gone, it’s now about sticking a label on them, justifying the behaviour with a condition and a shrugging of the shoulders by the parents “well what do you expect they’ve got ADHD/autism/anxiety”