There are many bargain basement contracting shops in the US too. Find half a dozen just graduated students who decide they're going to go freelance rather than going corporate - and you've got a contracting shop that is making web pages for the local stores or an access ERP-ish for the local business or someone who thinks that they can do the account management for their doctor's office.

And yes, the code that one finds after the eventual disaster when something goes wrong is staggering.

My anecdote for this is... I worked at a retail company implementing a new point of sales system. For a year before and the first year I was there (different team) there was an Indian "sales engineer" team that the vendor brought in. They weren't able to get the system working and integrated with the existing devices (it has to work with this receipt printer, this mag strip reader, this magnetic ink reader... these are the types of sales that we offer that aren't part of the core system, all rounding of pennies must be in the favor of the customer (1000 pennies in the favor of 1000 customers costs less than one complaint), etc...).

When milestones were missed, rather than revising the estimates, for it, the sales engineering team brought in more people. Aside from this courting Brooks's law, it again increased billable hours.

Aside from not getting it working, when management canned that approach all of the institutional knowledge of how it did work up to that point was lost. The documentation that was provided was worthless (but they billed their time to create it).

Several months later, the project was started up again - this time with a fully in house team. About two months in to the year long deadline (and for us it was a deadline - not just a milestone), we commented to management that we were going to need help getting this running - there was too much to do and not enough time. Within a month we got some consultants from intertech ( https://www.intertech.com ). And while there was some ramp up time with that code base, they were helping and contributing within two weeks.

Once the system was on track for the rollout, a large phase 2 project was given to them - returns. The business logic behind returns wasn't simple (do you credit the money back to a card? what if the card is a visa gift card? cash? store credit? restocking fees (none if the item is in stock, some if the item has been discontinued), taxes (purchased in state A, returned at another store in state B), etc...). The backend system chosen to handle this was drools.

Now, a outsourcing company here has two choices they can make. They can either try to make something that only they know how to modify and keep milking the project with billable hours until its replaced by another company... or they can try to transfer that information to the client (with training sessions (billable hours) and good documentation (billable hours)).

For the in house people who were going to be maintaining the system, we got excellent training and documentation. If they got up and left the next day, we'd be able to maintain it with only a minor hiccup. The cost to maintain it with a few in house developers was going to be less than keeping consultants on all the time.

The moral here is that it wasn't so much the "we can provide a solution" that won over the project but also the "we have demonstrated our competence in the first phase and can furthermore provide training to you that will decrease the maintenance costs over the lifetime of the project." Even with the increase of initial billable time - it was going to be cheaper.

The value was not only in the demonstrated competence working with the in house team (rather than trying to do it all), but in providing all of the associated support structures and soft things that management can see as improving the value of the service beyond lines of code written.