The make-or-buy decision refers to deciding whether a firm should buy the product/component directly (outsourcing) or manufacture it itself. There are a number of considerations for each side of the decision:
Make (in-house): cost (less expensive to make the part); maintenance of core-competence in house; better control of lead time, transportation and warehousing cost; integration of plant operations; using existing idle capacity; better quality and quantity control; items too specialized or with too small a demand to attract suppliers, etc. (referenceforbusiness.com)
Buy (outsource): focus only on core competency; supplier's research and capability exceed that of buyer; limited production capability; capital cost reduction; lack of expertise; items non-essential to strategy, etc.
So, depending on the particular situation at a firm or the strategy it intends to undertake, make-or-buy decisions are taken. The ranking of the motivating factors will vary from case to case. For example, IBM typically integrates everything in-house; Dell outsources a lot of their production; Apple outsources the component manufacturing, etc.