Roman elites, which included since the IInd century the whole of provincial aristocracies as well, found their best social and political expression (as much prestigious as it was profitable if well-handled) in the Imperial militia, meaning public service. Corruption and trading of favour was largely present, more or less tempered by imperial legal and executive reactions.
These elites, with the conversion of Constantine and the interdiction made to non-Christians to be part of the militia, were importantly Christianized : public servants, and the social classes they came from defined themselves both from their romanitas and christianitas (social markers that were adopted by Barbarians themselves up to the Vth century). Of course, as social elites, they didn't partake into a "common" Christianism : being a clergyman or a monk was rather too humbling and too simple, and more personal, ascetic or extreme forms (as pelasgianism) were more attractive to them.
Still, as the church went to be seen and modeled as an Imperial institution, it became sort of a "third power" between the aristocracy and the populus, benefiting from a moral ascendancy strong enough to force Theodosius to make a penance and to be seen as a necessary intermediary for the salvation of, necessarily sinning as being part of a para or illegal behavior. By the late IVth century, bishops were in facts assimilated as imperial agents, including in fiscal or honorific privileges, while free from the social prejudices being assimilated to a corrupt militia.
As the imperial authority declined, then eventually collapsed during the Vth century, the imperial public service took a bullet : apart from specific regions as Provence, salaries weren't payed anymore, the point of corrupting an imperial agent was moot, and middle and lower bureaucrats mostly disappeared from several regions out of a political network to justify their continued existence. On the other hand, aristocratic families did maintained their importance but on different lines : where they survived, they did it so until the early VIth century in an unstable political atmosphere were they tended to take themselves or to negotiate a local power that they were formerly delegated to.
Whatever places remained in the late Imperial or emerging Barbarian networks were expensive as much as precarious while keeping some prestige : an easy way out of public unemployment and to display one's social importance was to join the Church as sort of "Christian servants" : associated with upper classes, such service was neither degrading anymore, neither obsolete. Indeed, it survived relatively intact from the political collapse and bishops, monks, women with a reputation of sainthood emerged as organizers of local affairs as much as the lay authorities, taking over welfare, political negotiations, justice, even fortifications or military operations in some cases, and probably were used to manage communal and ecclesiastical properties as well as their own.
A whole world was translated from public service to clerical service, with its codes, culture and habitus; imitated from the late imperial administration (which had the effect to move out the popular aspects of ecclesiastical positions, except in peripheral regions). By the early Vth century, the Church became a recruitment pool for Barbarian states being constituted.
It wasn't an autonomous power or a full-fledged bureaucracy in itself, but an institutional refuge of the aristocracy that kept preserving its lay existence. Landowners but also secular elites that entered in negotiation with the Barbarian states and kings in defining their further integration in the former (which, eventually, took the form of Roman adopting Barbarian social codes): the late ancient public service didn't fully disappear before the late IXth century, although it went trough really important changes.
But, eventually, a life of public service tended to be crowned by an episcopal function, noble families did include bishops and abbots as much they included patricians or counts. In societies and royal networks that defined themselves more and more as Christian, this mix of militia legacy and religious charisma became definitely important.