In the 1800s, nationalism played a role in the rise of imperialism. Imperialism is the building of empires. It is done by claiming other lands and ruling them as colonies.
Many thought a country gained more power from having a bigger empire. As powerful European nations began grabbing territory in faraway places like Africa and South Asia, feelings of nationalism began to stir among the people who were being colonized.
In Africa, European landowners forced local farmers to stop growing crops for their own use and to start growing crops that the Europeans could sell for a profit. That left the farmers less time and land to grow their own food. Europeans did make some improvements in Africa, but they usually did that for their own benefit. In 1869, French engineers and Egyptian workers finished building the Suez Canal. This waterway connected the Red Sea to the Mediterranean Sea. The new route sped up travel between Europe and Asia. In 1875, the British bought the canal, because it shortened the travel time to their most valuable colony, India.