My current situation is:
Me, self employed, hired by
small agency, hired by
big agency, hired by
The end client deals exclusively with the big agency, which in turn deals with only six other agencies. There are people who have a further step, another agency which is hired by one of the six.
Advantage to the end client: a single point of contact for all their IT needs.
Advantage to the big agency: they only deal with six points of contacts. What these points of contact do is their own problem.
Advantage to me: I get paid. The agent who hires me pays my rate, whatever cut he can get is addded to that. I’ve known agents who charged a 10%, others who charged a “blind rate” (not related to how much they were paying) that could be as much as twice what the actual IT person was being paid.
Advantage to anybody else who can nudge its way into the chain: money.
We sign contracts, often as soon as the agent we’re directly dealing with gets us an interview, promising not to jump over their head. There are cases of people who do that, but it’s viewed as “burning your ships”: word gets around, so if you end up leaving that job you’ll have a reputation as an untrustworthy piece of shit - any agent who can offer someone else, will.
What do you mean “codebase maintenance”? The maintenance of the programs themselves? Those are usually handled by in-house personnel or by subcontracting firms with long-term contracts; there should be no more problem than with having your housecleaning done by MaidsRUs or your piping handled by a plumbing company rather than by in-house plumbers. Of course, how many problems you actually have depends on things like whether the documentation is any good - but, well, the people my “batch” of consultants replaced didn’t just have bad documentation skills, they were bad period; IME, good people leave decent documentation (it may be in .docs or it may be in *rems, but it’s there). I’m currently being sent home due to “temporary redundancy”, the end client thinks they can ask for me back when they need me again in a few months: I don’t know whether I will be available then, I do know that if I am I will ask for a higher rate, and I do know that my own documentation is good so if I end up being replaced, so long as my replacement knows his ass from his face he should be fine (I’ve had people who took other projects over from me, or clients, tell me years later that they loved my documentation, “everything was there!”)