https://ncrge.uconn.edu/wp-content/uploads/sites/982/2019/04...
Basically, non-gifted kids learn from the gifted ones. It's that whole, "positive influence from peers" thing.
In the long term, having gifted programs results in a handful of accelerated students and a lot more struggling ones (at the end of mandatory education).