There are two approaches that a company that requires some amount of something (accounting, payroll, IT, internal software development) (outside the company's core competency) can take (a former tech company I was employed at laid me off saying "web development is not our core competency"). Either the company will have an internal staff to do the development, or the company will use an outside source for that.
If this something is fairly consistently needed, it tends to make sense to have that be in house. A large retail company may find that it is more cost effective to hire its own people to do payroll and accounting than it is to outsource those tasks (compare this to a small company with 10 people total on staff where having payroll (done once per month) on staff would be substantial).
On the other hand, if the something is occasionally needed (legal help, IT development) or the staffing levels need to flex from few to lots periodically (tech support with a new release), it may become more cost effective to have that be done outside of the company rather than trying to maintain the staff in house.
Having a person on staff is not cheap. From things of additional payroll and benefits to less immediately identifiable things of additional facilities (phones, cube floor space). Additionally, having to staff down with a layoff is not cheap either (severance, California WARN law, paperwork).
When a given task is outsourced, all of those staff is not cheap things get moved to the outsourcing company. Less floor space is needed in the building, less water is used, etc... and when times get lean it tends to be easy to just say "project is canceled" without having to worry about down staffing at all (or reporting to Wall Street that the company is having a layoff).
In some cases, it may make sense for all of the in house development of internal software to be done externally. In the development context, there are repercussions to this in terms of quality of the item, ability to support it and turn around time for changes... but in some ways and cases, it may make sense.
So, why would a company be one that only does outsourcing? Because all of the above companies are hiring them to do it.