If a business has a project that will take a limited amount of time to complete, it doesn't make sense to hire a group of permanent employees to do it. However, most big programming projects are more of an evolution than a one-time thing. In that case, in-house programmers live with the changing needs, understand what's working and what isn't and make for a much more stable system.
Outsourcing will likely offer a lower short term cost while in-house offers long term stability and reliability. In short, outsourcing usually requires management to fit the operation of the business to the computer system while in-house allows fitting the system to the changing needs of managing the business.