States are pretty much in charge of running their own school systems (many states delegate most of this responsibility to more local governments), but the Federal government provides a lot of block grants with strings attached. There are many Federal programs and Federal regulations with which States must comply unless they are willing to loose a lot of money. A State's residents would still be taxed to fund programs even if the State does not participate, so States tend not to opt out for fear of subsidizing their neighbors.
You could compare the relationship between the Federal and State governments as analogous as that between public school systems and parent living in those districts. They are free to send their kids to private schools, but might not be able to afford it after being taxed to support the system which they could use for free.
The strings attached aren't always even closely related to the program. For example, a State might loose funding for its roads and bridges if its elementary schools don't provide subsidized breakfasts to children's whose parents have low incomes. (I'm not sure if that specific example is actually true, but there are many things similar to it.)
(Technically there is no minimum drinking age in the US at the federal level, but states must make it illegal for anyone under 21 to drink if they want to get any highway funds. For years Louisiana kept its drinking age of 18 because they figured young tourists and especially Spring Breakers would bring in enough tax revenue to offset it, but eventually they gave in to the federal road bribe. Similarly Montana eventually gave in and established speed limits in exchange for federal funds, although I think the accident rate was actually lower there when their roads were as unregulated at the Autobahn.)