Early American education was primarily religious in nature. We refer to this as the "permissive" era of American Education. During this stage, the establishment of public schools had to be approved by local governments. This was followed by the "encouraging" era, during which local and state governments encouraged the organization of schools and school districts. Children were not required to attend public school.
While government-supported, free public schools existed throughout colonial and early America, (many later ones thanks to the efforts of Booker T. Washington, Horance Mann, and others), prior to the mid-19th century, schooling at home was the predominant form of education in the United States. However, the influx of European immigrants in the mid- to late-19th century and the dissemination of support for "Progressive Education" by John Dewey and others spawned the spread of public education.
It is commonly stated that one reason for the increase in public education was to incorporate immigrant children into American culture and to establish social order. This, coupled with support for Progressive Education that focused on the preparation of each individual to reach their full potential and play a role in our democtractic sociey, led to an increase in both elementary and grammar schools and the development of well-structured secondary schools (high schools).
Thanks to legislation making school attendance compulsory, a significant majority of American school-aged children were enrolled and attended schools by the turn of the 20th century. This marked the beginning of the "compulsory" era of American Education.
One view is that American public education is a social construct based on the social inequities that have been combated and/or mitigated through legislation that has been imposed throughout the 20th century. This includes racial desegregation in Brown v. Board of Education, the desegregation of students with special needs in PARC v. Commonwealth of Pennsylvania and Mills vs. Board of Education of the District of Columbia, the requirement that students with special needs be provided with a Free and Appropriate Public Education (FAPE) in the Least Restrictive Environment (LRE) under the Individuals with Disabilities Education Act (IDEA), and aid for disadvantaged students in the No Child Left Behind Act of 2001 (specifically focusing on students with special needs, economically-disadvantaged students, and students whose ethnicities have not traditionally performed at mastery or above on standardized assessments), just to name a few.