I would say that gifted students do not have a lot of opportunities in the public school system to achieve great results and get challenges. The public system is for average students and students below the average. However, if students want to apply for special programs (like SHSAT in NYC, for example), they need to be much ahead of the school program. Even if there are some programs for advanced students, they are very competitive, which means students have to get the top scores on the particular tests to get to those programs or schools. That leads to a special preparation.
So, there are two big problems. On the one hand, gifted students need to be challenged, get a more profound program/knowledge (compared to the public school), and go ahead of the school program. On the other hand, such students need special preparation to get into special schools.
Students don’t get enough challenges at school. If talented kids do not get the level of knowledge above and get only the program below their level or the same, they are not motivated to continue growing. Such kids need competition to keep developing. That means they need to be in an environment with bright kids who study on the level above.
Learning motivation is crucial for gifted kids. That keeps them moving. Otherwise, they start asking why I should work harder if I am above the others? That is why such students have to be on the special programs: they need to see that other bright kids stand out.