When producers are heterogeneous, the degree of competition between them affects aggregate output not only via markups and deadweight losses, but also through aggregate productivity due to specialization. As competition tightens, high-productivity producers gain market share at the cost of low-productivity ones, generating economic growth through increased aggregate productivity and capital accumulation, in line with what is observed empirically. Consequently, competition is not limited to reducing deadweight losses, and can play a greater role in economic growth and development than traditionally assumed. Economic growth spurs profits, which leads to entry and increased competition that generates growth, so competition provides a channel through which the economy generates growth internally. When strong enough, this channel can make the returns to scale in the inputs that the economy accumulates endogenously go from being decreasing to nondecreasing at the aggregate level, thus enabling endogenous growth. In fact, these returns to scale are determined endogenously in our model, and vary with the scale of production, the degree of producer heterogeneity, and the barriers to entry.