My highschool Latin teacher once told our class that before colleges and universities were formed, nobles who enjoyed intellectual pursuits would pool their money together and hire an expert to teach them. I have no idea if this is true or not, but it did make me wonder about the history of educational institutions. From what I've been able to discover on my own, many places of education were sponsored by a particularly benevolent ruler. How then did private educational institutions come about? Or more importantly, when did providing education become economically viable (i.e. enough people were willing to pay enough money) that people would try to create their own school? I'm going to limit my question to Western Europe, since asking for an answer to such a question in context of the entire earth would probably be far too open of a question to be able to answer.
hi! there's lots of room for more information that specifically address your questions, but meanwhile you can get started on this section of the FAQ*
also, you may be interested in this terrific thread, in which /u/Ambarenya describes life - including education - in Constantinople c. 400-1200AD
*see the link on the sidebar or the wiki tab