It happens in all martial arts schools. Children change as they grow up. During my karate years, I often saw kids start like tykes, doing awesome both in kata and kumite. And then, as soon they reached their early teenage years, they changed, became lazy and and unmotivated. Then they would quit. It happened so often - although not systematically - that I was against starting them at a very young age and I advised parents to wait until they were a bit older.
Another problem was precisely when they had to graduate from the kid's class to the adult class. Some of them struggled for a while before adapting. Others found the new standards offered by older and more mature partners overwhelming, even for kata. And it was not a belt problem. The belt system was the same for the whole school.
My own nephew started taekwondo - in the United States - at age eight and made it to black belt two years later. Then he quit.
How do more experienced instructors tackle these problems?

Part of the problem is emphasis on belts.

Belts are the worst reward system ever invented for martial arts. I've talked with a few "Mcdojo" instructors and I get the same response. The idea is to put them on a tredmill where they keep getting new belts right before they get bored until they reach black belt, then 98% will quit (because they won the game) the rest will stay to become teachers in the circle of mcdojo. So they change high prices will the expectation of turn over in 1-2 years (average time to black belt in most mcdojos).

This is a no child left behind approach to martial arts. Basically you make it easy fun and keep them interested with some tangible thing they get to keep. This motivates kids to do just enough to 'win' and keep showing up.

A better approach is no belts, or at least using belts for what they are for (classifying people into grades to prevent injury and promote fair competition). There are many other ways to reward children for doing good. My bjj instructor is like this. None of his kids have a belt above yellow (the second belt after white). He promotes yearly (adults, kids, etc) based on skill. He also makes no guarantees of belts.

Yes, this may hurt some feelings and some students will quit when they are left behind because they were not learning at the same rate as their peers, however, I do see his class has consistently more kids that stay for longer then the local belt mill. I have to think it is because the kids are being challenged, encouraged and rewarded with honesty and praise, not black belts. Even for the adults it's not about belts. I don't know anyone who asks when promotions are, or talks about how they want their purple belt so bad. I have seen guys quit who did not get promoted, but they did not belong there anyways.

It is no longer what rank you have, but what can you do. I see this in judo too. I've seen kids argue over rank. But in schools that do not focus on rank, but forcus on randori, they don't argue about it anymore.