To uncover the secrets of creating competitive advantage for firms under demand uncertainty, we study the roles of technology level and capacity investment strategies. Specifically, we analyze the Nash equilibrium of two competing firms at different technology levels under two capacity investment strategies, namely flexible or inflexible. We examine both symmetrical competition where the two firms adopt a same capacity type (flexible or inflexible), and asymmetrical competition where the two firms invest different capacity types. We find that an advanced technology level incentivises capacity expansion regardless of the capacity strategy adopted. In addition, the technology-capacity relationship significantly depends on demand distribution when both firms adopt inflexible capacity investment, but is independent of demand distribution when both firms invest in flexible capacity. No overwhelming superiority is observed from either side when both firms adopt the same capacity investment, and firms always co-exist in a profitable market, despite significant differences in technology. However, overwhelming superiority emerges from one side when both firms have different capacity investments. A firm can squeeze out its competitor and capture the entire market by upgrading its technology. When the two firms adopt the same capacity strategy, each firm may increase or decrease its technology level and capacity volume proportionally in equilibrium, regardless of the competition scenarios. We further explore the endogenous capacity investment type and technology flexibility in competition. We show that the competition effect plays an important role when the flexible capacity cost is moderate.