Your question is a great question. For a kid growing up, it is really necessary to learn or study in the school in the sense that when kids study in a school they get more exposed and learn how to be social that is interacting with other kids outside.
Kids also learn to be bold and courageous when they exposed to academic facilities. Taking myself for example, I was able to overcome shyness when I was in nursery school, I used to be selected for drama roles and fortunately for me I played the lead role everytime that really helped boost my level of boldness and being outspoken.
Being outspoken can be a problem to both kids and even adults so studying in a school for kids is really important in my own opinion.
As for adults ,studying in a school is not really a necessity because being an adult, the person would have gone through life and had experiences so such person would have known how to be social already.
This is my thought regarding your question.
Yes, it is, in most of the countries school is mandatory. Some countries allow homeschooling, where children can learn at home and then take the necessary exams.
Some countries where remote areas can make it difficult for kids to go to school, there are classes transmitted through radio.
And there are countries with extremely high rate or illiteracy, where I don't think school is mandatory or people are so poor they can't afford to send kids to school.
If you ask me, I prefer school for kids, rather than homeschooling and not just because of the learning process. Teachers are trained to teach, they know what to do, which might not be true in case of parents. The other most important thing we have to consider when it comes to schooling is kids being together, learning to cope with different situation. Playing together, taking part in sport and others activities can be very beneficial.
What's the difference between going to school and education. Most people go to schools but they aren't educated.
It's necessary to study in school because most things taught in school can't be learnt at home effectively because the school environment is quit different from that of the house. In school, you meet new friends, see new attitudes, etc.
So yes it's necessary to study in school.