I've subcontracted out to folks, and even at a 2x markup, with the coordination, review, and other unbillable activities I made almost no profit. As a percentage, it was barely worth even having the initial leverage and I rarely did it (at 2x markup) unless it was strictly to meet a deadline. In large orgs where profit is a requirement for just about every interaction I can see how 3x or 4x would be necessary to justify doing the work in the first place.
Then the consulting agency obviously makes a nice profit off of it.
And then the consultant themselves can usually benefit from it as well, because typically they get a higher wage than the average employee to begin with, and also it becomes a very easy conversation to have with the company "just hire me as a FTE instead of paying the consulting company. My salary is currently $50/hr, you're paying them $150/hr for my work. Instead you can just pay me $100/hr, and we both benefit." I've seen a lot of consultant -> FTE transitions happen like that.
That only does work if the company is actually looking for a long-term FTE, though. Like I mentioned above, a lot of the time the company is paying the premium in the first place is so that they can quickly and easily drop you off their payroll if needed. They lose out on that by bringing you on as FTE.
The percentage that is overhead will vary, but only by so much. Otherwise, someone will come along and find a way to undercut your prices and take your business. It's reasonable to assume that if one hourly cost is double another, the developer's pay is higher.
(Not denying someone might find a way to really pull a scam in the short-term, and find a kid they can pay minimum wage to, but that's not a scalable or stable arrangement).
That's really only true if you assume that all of these dev agencies are equal. In reality, a lot of them have different specialties (both tech wise or industry wise), better (or worse) reputations, or certain partnerships. All of these things can greatly change the amount that the dev agency can charge.
I've personally seen plenty of agencies charging $100/hr while another agency with a different "specialization" (but otherwise similarly skilled and paid devs) charge $250/hr. The bill rate hardly ever corresponds with salary, IME.