I've been reading a book called The Inheritance of Rome: Illuminating the Dark Ages which answers part of your question; I'm not qualified to speak on anything past 1000. However, before 1000, aristocracy was closely tied to positions in the church. Before we can begin, we should clarify that there were three (arguably four) classes in early medieval society; unfree peasants, who were basically serfs and made up a small portion of society; free peasants, who owned at least part of their land and worked under a lord; the aristocrats, who owned most of the land and generally fought most of the time, and the priests and clerics, who drew from everyone except the unfree peasants. On the one hand, the church was more open to peasant clerics; low-born bishops were somewhat frequent, and even a few archbishops were of lowly origins. Even low-born lords showed up from time to time, such Leudast of Tours, a peasant who came to rule one of Francia's religious centers. However, most clerics, and almost all clerics above the bishop level, were of aristocratic birth. Aristocrats in this period were defined more by their power and lifestyle than origins, as Leudast indicates, and many bishops and archbishops lived well and ruled territories like feudal lords. However, this lifestyle was expected from everyone of high status, and people from free peasant backgrounds rarely had the money or political connections to support themselves. The peasants I've been talking about were free peasants; unfree peasants lived absolutely at the whims of their overlords and were unable to enter the church without their permission. So, while the early medieval church was more meritocratic than secular society, it wasn't a true meritocracy. I hope the little I have to offer helps you, and that someone who knows the subject better comes along and elaborates on the late middle ages.