Historians generally recognize that nationalism developed in Europe over the course of the nineteenth century. Many find its origins in the French Revolution (1789-99) and the Napoleonic Wars (1803-15) a substantial stimulus, as French nationalism was met with reactive opposing "nationalisms." At this time, the borders of states did not correspond to national identities, or from a different angle, nationalism had not developed enough to challenge the integrity of multi-national or multi-ethnic states.
The most dramatic economic shift that occurred in the nineteenth century, and arguably in modern history, was the Industrial Revolution. The Industrial Revolution (which might be defined as the transition from the manual small-scale production of finished goods to mass factory-based production) led to a number of developments that contributed to the growth of nationalism, which in turn contributed to the emergence of nation states.
The emergence of railway transport and newspapers, in particular, helped forge common national identity in countries. Peasants could travel from the village to the city for seasonal labor. Inhabitants of one city could travel to other cities for business. Papers published in the capital could be distributed in multiple major cities. All this helped create a sense of familiarity with places and people who were previously distant and helped build national communities.
In some countries, particularly in multi-ethnic empires, like Austria, Ottoman Turkey, and Russia, the growth of nationalism could also lead to the alienation of ethnic minorities. Majority nationalism could lead to reactive minority "nationalisms." One could look more closely at any one of these examples with minorities breaking away and/or asking for a political voice. The resulting precarious situation contributed to the collapse of all three of these empires during World War I (1914-18).
In short, nationalism could help bring people together, with the help of economic development around a common national identity and help create and solidify a nation state. It could also alienate minorities and thus destabilize empires and ultimately lead to the creation of smaller new nation states. The latter example can be seen by comparing a pre-World War I map of Europe to a postwar one. Industry also created the capacity to wage mechanized warfare as well as the ability to harness populations to support militarism, without which World War I as it unfolded would not have been possible.