This study is motivated by examples of outsourcing that are not readily explained by widely established economic theories. We extend recent literature that develops the idea that outsourcing can help firms avoid overinvestment by specifying more precisely the conditions under which this thesis is likely to apply. Our extension is realized through a two-period game theoretic model in which the outsourcing and in-house investments are driven by (1) the cost required to develop a product or process module, (2) competitive relevance, defined as the module's share in the production cost or the module's importance to the customer, and (3) modularity, defined as the extent to which generic investments in the module can approach firm-specific investments in terms of the overall product/process performance. The analysis generates predictions about what types of insourcing, outsourcing, and non-sourcing behaviors are likely to emerge in different parts of the parameter space. Outsourcing to a more concentrated industry upstream emerges at equilibrium when modularity is high, relevance low to medium, and development cost high enough that none or only a subset of focal firms wants to invest. While firms are forced to insource and overinvest due to a prisoner's dilemma when the development cost is sufficiently high relative to the module's relevance, we do not find outsourcing equilibria that solve this problem in a two-period game with no commitment. This result implies that some form of tacit coordination in a multi-period game may be necessary. We conclude the study with a discussion of empirical implications.