As Adam Smith explained in his pin factory example, when people specialize, their productivity increases over time because they are getting better at what they are doing. On the other hand, if you don't specialize in a specific task or activity, your productivity won't increase as much because to do so you need to get better at everything you are doing. Assembly lines in the automobile industry illustrate perfectly that case. If each individual had to build the entire car, automobile manufacturers will never be able to assemble as many cars. It is because each individual is specialized in a specific task that they can build as many cars.
Specialization leads to increase in productivity gains because with experience you learn how to do things better and faster.
The question that follows any discussion about division of labour is what are we going to specialize into? The answer comes from David Ricardo: we will specialize in activities where we have a comparative advantage.
But, for all of this to be efficient, we need to have free trade. Without free trade, there is no reason to specialize and the division of labour won't happen. As Adam Smith explains, the division of labour is limited by the extent of the market. The bigger the market, the greater the specialization. This is why we have so much specialization because we are in a global market. However, it is important to understand that this can only be effective only if we have free trade and open immigration. Mises called David Ricardo's law of comparative advantage, the law of association. Division of labour, specialization, comparative advantage, and free trade allow individuals to associate themselves with other individuals. Mises's point was also that by depending of each other has a result of the division of labour, people, instead of engaging in plunder and violent behavior, were engaging in trade and at peace with other because both parties benefit from the trade.
Similarly, one has to keep in mind that comparative advantage in one activity is not frozen over time forever. As more and more people participate in trade, who has a comparative advantage will evolve over time and people who had a comparative advantage in one activity might find themselves no longer having it. But this doesn't mean they don't have a comparative advantage in another productive and profitable activity. Note that usually when somebody comes along and can make something cheaper everybody benefits because it frees resources allowing people to use these resources to produce other goods and services that might be more costly to make but now can be made because some resources have been freed. As the division of labour and trade grow, the human conditions are improving for everybody. Only people who refuse to embrace the division of labour and free trade suffer.
Russ Roberts makes a great point when it concludes:
"This is the story of American economic life in the 20th century. Innovation and expanded trade reduce the number of Americans necessary to produce what we want. Yet the number of jobs doesn't fall. The number of jobs grows steadily with population and the desire to work. As innovation and trade reduce the number of people working in agriculture or manufacturing, that frees up capital and human skills to make other things, things we couldn't have if we lived in a static world, the antibiotics and iPods and cell phones and heart valves and MRI machines and flat screen TVs. Banal things and glorious things. Things that entertain and things that extend our lifespan. Our skills and the skills of the next generation can turn to creating and making those things.
Not everything we do well is worth doing. And even the things worth doing now are not necessarily worth doing tomorrow. Self-sufficiency is the road to poverty. Innovation and trade are the road to prosperity."