Education is not what the teacher does: it's what the student does. Most people think that the job of a teacher is to organise information and explain it to students to make it "easy to understand". This is just plain wrong. In fact, by doing so you cheat your students because you steal their opportunity to organise information and discover how to understand it.
1:1, 1:2, 1:20, or 1:40 doesn't actually matter from a perspective of teaching material. If we make the teacher the font of all information, then we also make the teacher the bottleneck of learning. I was teaching language and if you want native level fluency and proficiency, then you might need to spend up to native level time acquiring the language. In other words, to get to a 10 year old's ability, it might take you up to 10 years of nearly full time practice. Sorry, but I'm not going to teach you 58,400 hours (10 years, 16 hours a day) unless you have Bill Gates level money to spend.
So, you're going to spend something like 3 hours a week in my class, and only something like 30 of those weeks are going to be productive in a year (if I'm lucky). So that's a pidly 90 hours of instruction per year. I'm going to teach you practically nothing in that time.
This is what is wrong with education.
But getting back to 1:1 vs 1:40. In a 1 hour class, if I have 40 students I can spend just over a minute paying attention to each student. In other words, I'm going to present my pidly amount of information and hope like hell that you're going to do something useful with it -- because I do not have enough time to interact with even one person in the class. If you assume that 1 in 40 students have a behaviour problem (just 2.5%!) you will see that I will expect to be interrupted in every single one of my classes. So probably I won't even be able to present my pidly amount of information. Probably I will just babysit and the students who know how to study will do well, while the others do poorly.
As we reduce the ratio, I have more time to interact with the students. But it's really important to realise that if I waste that time trying to teach the material, I will do no good. So in fact, what I want to do is let the students study and then watch them so that I can can correct their behaviour. By doing that, they can become good students and succeed in studying.
How many students I can handle depends a lot on my class management skills and also on the students. Some students require no intervention. They just need a friendly, welcoming, and engaging environment in which to study. Some students need considerable attention. 1:1 might be amazing for some students, but even 1:10 or 1:20 could be amazing for others (depending on the teacher). Some students like to study alone, some like to study in pairs, some like to study in groups. You have to be flexible.