It is a conduit through which funding flows and is a standards and enforcement body.
They (or at least, they used to) insure that "state's rights" advocates don't implement curricula that teach children that the world is 6,000 years old and flat. They are in the process of being dismantled.
One's local school district is responsible for a vast majority of one's critical thinking skills and it has been this way in the United States since at least the early 1800s when people realized that only wealthy parents had the time, energy, and money to hire private tutors to impart critical thinking skills on their children.
I imagine that in other countries, especially western countries, the story is the same.
We can look back far into history to see that people have used state-run or sanctioned institutions to teach critical thinking skills since well before the Platonic Academy, from which much of our modern system is derived, based on evidence of organized vocational education ranging from Siberia to Ancient Egypt to city states that dotted the land prior to the Old Babylonian Empire.
The main difference between those ancient systems and today is that, for now, all children get the chance to have a formal, standardized education, instead of just the children of the wealthy, well-connected, or lucky.