Some parents leave their kids in diapers and not potty train them because it's easier for the parents to change a diaper and not deal with potty accidents.
Some kids also are not ready to potty train until 3 to 4 years old so some parents don't bother until then as well.
I have one kid who would not potty train until he turned 6 years old so I gave up after age 4 and kept him in diapers until a few months after his 6th birthday when decided he wanted to use the toilet.
He's home schooled so no issue about going to school and it was just less frustration leaving him in diapers until he decided he wanted to stop wearing the diapers.
School aged children can wear diapers if they need to.
Although kids must be potty trained to attend school the child can wear diapers to school or wear them at any time that they need too.
If a child is wearing diapers in school then they may be put in a special ed class or at least have it noted down that they may need to see the nurse about diaper changes.
The school can make arrangements so that the child can change their diaper in private and not have to do it in the public bathroom which makes it less embarrassing for the child.
I worked as a teachers aid and we had a 7 year old boy student that was incontinent but had no mental disabilities or anything else wrong with him.
He wore diapers to school and we kept some in the nurses office for him and he could change in the nurses bathroom.
He wore Luvs size 6 diapers which is what fit him as adult diapers were too big and pull ups would leak on him.
The point of making your kids wear a diaper is to keep the kids clothes clean and also to keep your furniture, carpets etc clean.
If a kid who is not potty trained does not wear a diaper then they will pee and poop in their pants and get it all over them, the bed, your couch, the floor, in your car etc.
Without a diaper on the kid who's not potty trained there would be a huge mess and it would be unhygienic and unhealthy for the kid to be peeing and pooping on themselves and in their clothes.
When babies are born they have no bladder or bowel control and even as the child gets older and reaches 2 to 3 years old the child's bladder is still weak so they can't hold it very long.
So a child who is wetting their pants or pooping their pants or those who are not potty trained will need to wear a diaper.
Even if the kid does not want to wear the diaper they must be made to wear the diaper if they are not potty trained.
Or if a kid is incontinent or bed wetting then they should wear a diaper to keep them healthy and clean.
Some kids potty train by age 18 months and some are not ready until 2 to 3 years old.
Then again some kids may not be potty trained until 4 and even 5 years old.
Every kid is different and will eventually potty train and want to stop wearing diapers but until then the child must and should wear a diaper.