Reasons behind Hogwarts
About a thousand years ago, the four witches and wizards began a great experiment. They founded a boarding school for young witches and wizards of all social classes. Everything about this is revolutionary for that time and place. Why did the Founders choose to go this route? Are there any other purposes for Hogwarts besides simple education and training? I suggest that there are four reasons (although none correspond to any of the Founders and one, as we know, objected strongly to one of those reasons.) These reasons are Education, Indoctrination, Socialization and as a Marriage Mart.
First, we have to look at education during this time in British History. We don't know the exact time of the Founding, but Professor Binns, in Chamber of Secrets, which took place in 1993, said it was over a thousand years ago, which places the Founding in 990s. (As a side point, this means that the Longbottoms and the Weasleys, who are very old families indeed, would very likely have had students in the first classes, while the Malfoys, whom I believe came with the Normans in 1066, would have been somewhat later. I have no clue about the Blacks. But I digress.) Education, if it happened at all, happened inside convents and monasteries for those with religious vocations and/or sufficient family wealth to pay for the education, or in the keeps of nobles and the homes of still-new merchant class. That is, for those with money and/or rank. And even then, it would mostly be for boys other than those girls in the convents. Everyone else learned only what they needed to earn a living from parents or masters - and that usually didn't include reading. Hogwarts, as an essentially secular school dedicating to educating children of all classes and both sexes, would be unheard of.
So why start it? The reasons, according to Professor Binns, were because of increasing persecution of wizards and because young wizards and witches needed to be taught - the Founders may have differed on who deserved it, but they agreed that it was needed.
I can only conjecture about preHogwarts wizarding education, and that would depend a lot on the resources and background of the parents. For this purpose, I'm going to use the terms Wizardraised and Muggleraised, because, as Harry's experiences have shown, it's not in the nature but the nurture.
Children raised in wizarding households would, of course, be taught the basics by their parents, who would also get them their first wands. I can see young wizards sitting by the hearth, being taught potions by one parent, while young witches are taught hexes out by the apple orchard by the other. Except that as the need for secrecy grew, they might not be under the apple tree. Eventually, these children would be apprenticed to some witch or wizard who could teach them a specific skill (probably just before puberty - say at age eleven.) Or they'd stay at home and learn their parents' profession. Pretty much like Muggle children, really.
And, just like their Muggle counterparts, the wealthier ones would have private tutors, with the difference being that witches would receive the same education as wizards. I was going to say that there probably wouldn't have been convents or monasteries, but that doesn't make any sense, given the Fat Friar. What makes more sense is that there were, and probably *are*, Wizarding orders within the Church, and so there would be abbeys to send kids who had callings or who needed the sort of discipline a convent could bring. So, again, not so different from Muggle children. However, it would mean that truly talented wizards born to poorer families might not get the training they needed and it certainly would make a patchwork of education in general.
Muggleraised children, on the other hand, would face a nightmare. No one would know how to train their abilities, so they'd be self-taught at best. This, of course, is assuming they would be allowed to use their powers, or ever got in control of them. They'd certainly not receive wands. They would probably be dangerous to those around them as their uncontrolled magic would flare during moments of anger or fear or high emotion of any sort. We've seen this with Harry, even after he went to Hogwarts.
However, I'd think they'd be in more danger from those around them. A child manifesting those abilities might well have been cast out or even killed - although I suspect that the children's magic might have protected them. Again, conjecturing from Harry - his aunt and uncle never hit him. Aunt Petunia once aimed a frying pan at him, but he'd ducked and that was that. That does seem out of character - perhaps they tried to hit him when he was very small, and his magic fought back, and the Dursleys decided not to chance it again. Then again, Dudley hits him. So, who know?
If they weren't killed but were cast out - if they survived on their own to adulthood - I'm not sure what would happen to untrained adult wizards, but it may not have been very pretty. They'd end up alone and frightened of themselves and the world. On the other hand, such children may have been fortunate enough to be found by a kind wizard or a witch to bring up. Others, well. May have been unfortunate enough to have been found by a not-so-kind wizard or witch.
This was not a good state of affairs - the Wizardraised getting this unorganized, stratified and secretive education, probably full of misconceptions and folk wisdom, and the Muggleraised not getting much of anything at all. Clearly the Founders thought it bad.
By creating a central school, they solve a number of these problems. It creates an organized curriculum so that children's progress can be judged and rated and perhaps helped along. Because there would be several teachers, there would be a wider range of subjects available to each student, not just what their parents or their tutor knew. And as it would be open to all students of all classes - class doesn't seem to have been a factor in the arguments among the Founders - all witches and wizards would be able be educated and on the same level.
There are other benefits. Because it would be secret, the students would have a chance to safely practice skills that would be too dangerous to do in the home village. More than that, since they'd be supervised by knowledgeable people, they'd be able to build these skills properly.
Most importantly, it would give the Muggleraised a fighting chance, provided they could be identified. I do believe many would have been killed as, well, witches, before the founding of Hogwarts and the discovery of some way of identifying magical children. And they get the training and tools they'd need to be proper wizards and witches. (And, again, this is pure conjecture, but somehow, I imagine it was Helga Hufflepuff who created the detector. She was the only Founder who just wanted to teach them all, so she'd be the one most concerned about the Muggleraised. Helga is rapidly becoming my hero.)
And this leads us to Indoctrination. Indoctrination would be most important for the Muggleraised, who would be entering an entirely different world - one similar but not identical to the world they left. They would be introduced to the society through their Housemates and lessons and just the general school society. The school would also create a great deal of loyalty to itself as well as the Houses and the society in general. It seems to work - look at Hermione, who thinks of Muggles as "they" and who chose to spend all of her holidays with the Weasleys instead of her own tolerant and loving parents. She fully identifies as a witch, even if a portion of the wizarding world considers her beneath them.
But it also works for the Wizardraised kids. While it's clear that they never lose loyalty to their families and that the values of their families determine, to some degree, their Houses (Malfoys are always Slytherins; Weasleys are always Gryffindors; Sirius bucked a longstanding family tradition by going to Gryffindor), it's also clear that House culture also plays a role in shaping the students. Hermione, who would have been fit in quite well in Ravenclaw as she was in the beginning, is as reckless as any Gryffindor now.
There probably was some idea that a unified education for all across class and blood lines would create a unified set of values for the Wizarding world, but that would have failed. The Houses keep the differences alive, and Wizardraised children would keep to their own families's values and ideals.
However, it does lead into Socialization. It's the thing that brings all of Wizarding Britain together - members of all classes live, eat and learn together. This would go for all the houses - just because Slytherin only accepts full and halfblood students doesn't mean they're all of the same social class. We know this for a fact - Draco Malfoy, of family, property and wealth, was sorted into the same House as Tom Riddle, who was a Muggleraised half-blood with nothing at all. And could have taken Harry Potter, who is also a Muggleraised half-blood, and who didn't even know he had money until a month earlier.
The way I see it, the Sorting Hat takes into account two criteria - does the student fit the mandate of the House and does the Student want to be in the House? And it weighs the second one more heavily than the first. We've seen this with Hermione, who had to argue to be Sorted into Gryffindor, but who won that argument handily. It does not take family background into account, other than the need for Slytherins to be at least half-blood, or rearing or money.
So, from the very beginning, students from all walks of life were put together in a situation that creates strong and probably lifelong bonds among age and House lines. More than that - in three of the Houses, Muggleborn would be included in those bonds, and so they'd be a part of wizarding society. They'd have connections that would enable them to find their way in that world to make up for the ones they lost or rejected when they left the Muggle world. That is, they can assimilate properly.
It also creates a bond among pretty much all British wizards and witches, because most of them spent at least five years in Hogwarts (I assume that students who fail to get any OWLs simply do not return for the last two years, although it's possible that they can retake them in their sixth year and then take NEWT level classes their last two. This is probably what happened to Marcus Flint.) After all, all wizarding children, other than Squibs, get a Hogwarts letter, and while I assume some go to Durmstrang or Beauxbatons or maybe Salem, or are taught at home, most would go to Hogwarts. So, any group of witches or wizards of any combination of ages can reminisce about the school, at least to some degree. For example, Binns has probably taught multiple generations. Shared memories can create strong bonds even between strangers.
Beyond that, most wizards know pretty much everyone their own age, and everyone within a couple of years of their age in their Houses - plus whoever they got to know in the various clubs and societies and Quidditch teams. There are no strangers in the adult wizarding world - just people who know each other far too well.
Which is why Hogwarts' fourth role is that of matchmaker. This is a mixed school - boys and girls share the building, the Houses and the classes. How radical is this? Well, in early 20th C New York public schools, they had separate boy's and girl's classes - even a Boys High School and a Girls High School. In one room school houses, the boys sat on one side and the girls on the other, and it was a punishment to be forced to sit with the other sex for an afternoon. We still think of private schools as single sex, and certainly we think of British public schools that way. Smeltings sounds like it's single sex, for example.
But what is more amazing, at least to me, is the shared Houses. We have teenaged hormone factories sharing the same Common Room, virtually unsupervised other than their own peers. Charmed stairs or no, this is asking for problems. It is also creating a situation where romances will form, either within or between Houses. Thus far, in fact, most of the romances we've seen have been interHouse - Percy and Ravenclaw Penelope, Hufflepuff Cedric and Ravenclaw Cho, Harry and Cho, Ginny and Ravenclaw Michael. Only at the end of OotP do we see intrahouse relationships - Ginny and Dean; Cho and Michael. Still. Ravenclaws do get around, don't they?
James and Lily married right out of school. No one seems surprised at that. And why should they be? Everyone at Hogwarts knows that they know everyone their own age, and therefore every potential marriage partner unless they marry someone from abroad or out of their immediate age group - or choose to marry a Muggle or maybe a Squib. This doesn't mean there aren't arranged marriages, of course, but they're probably going to school with those arranged spouses anyway.
And this is, I believe, on purpose. The wizarding population is very small and spread out, with what seems like fairly low fertility other than the Weasleys. The Blacks, with two and three children in a family, are practically record setters. It's also highly inbred because of the small population.
Hogwarts, by mixing everyone together, helps limit at least local inbreeding, although I think some families, especially those in Slytherin, would discourage relationships with nonpurebloods. It would not, I think, eliminate class problems, although Arthur Weasley, who seems to be of the gentility, did marry Molly Prewett, who seems lower class. This is probably less then common, given the British class consciousness.
Also, because Muggleborns would be part of the whole by the time they leave school, they would be considered as possible marriage partners by all but the most particular of purebloods. No one, for example had any problems with Pureblood Percy dating Muggleborn Penelope. His siblings thought it was funny, but they *would*. And they wouldn't have met if it hadn't been for Hogwarts, any more than the pureblooded James would have met the Muggleborn Lily. Or Andromeda Black met Ted Tonks. By fostering these relationships, Hogwarts has enabled the Wizarding world to survive, since, as Ron said in PS/SS, if it weren't for Muggle blood, they'd have all died out.
Hogwarts main function is to educate young witches and wizards so that they can control their powers and contribute to their society. This is as important today as it was 1000 years ago. However, it also serves to protect young Muggleraised witches and wizards by giving them a place of safety and training, and it helps to assimilate them into the Wizarding world. It also creates both the memories and the families of the wizarding world, as the students form bonds with the school and their Housemates, and marry the people they met there. It is, in fact, the glue that holds Wizarding Britain together - the thing most of them have in common. It's more important than the Ministry, in fact, which has less of an impact on the day to day lives of the ordinary witch or wizard. This makes Dumbledore the most powerful wizard in the country - more so than I'd thought before writing this essay.