This paper constructs a theoretical model which introduces flexible manufacturing to study the causes giving rise to subcontracting. The main findings of the paper are as follows. Firstly, owing to an inability to flexibly manufacture, the consignor would choose to subcontract out its production even if the production cost of the subcontracting firm is higher than that of the consignor, when the variance, i.e., risk, of a demand shock is large. Secondly, when subcontracting does not occur, the cosigner's capacity investment increases as the variance or the mean of a demand shock rises. However, given that subcontracting occurs, the consignor's capacity investment will decrease as the variance of a demand shock rises. Thirdly, the smaller the consignor's marginal cost of capacity investment, the less the possibility of the emergence of subcontracting due to a fall in the comparative advantage of the flexible manufacturing owned by the subcontracting firm.