In the Joseon Dynasty, hyanggyo were established in every bu, mok, daedohobu, dohobu, gun, and hyeon (the last corresponding roughly to the size of modern-day cities and counties). They served primarily the children of the yangban, or ruling elite upper-class. Education was oriented toward the gwageo, or national civil service examinations. Although such education was in high demand, the hyanggyo were ultimately unable to compete with the privately run seowon and seodang.
Based on the civil service examinations of imperial China, the gwageo first arose in Unified Silla, gained importance in Goryeo, and were the centerpiece of most education in the Joseon Dynasty. The tutelage provided at the hyanggyo, seowon, and Seonggyungwan was aimed primarily at preparing students for the gwageo and their subsequent career in government service. Under Joseon law, high office was closed to those who were not children of officials of the second full rank or higher, unless the candidate had passed the gwageo. Those who passed the higher literary examination came to monopolize all of the dynasty's high positions of state.