Answer explained
Nationalism emerged as a major political and social force of the modern age, inspired by the ideals of "liberty, equality, fraternity" of the French Revolution (1789). It awakened in people the consciousness that they were not merely subjects of a king, but citizens of a nation sharing a common history, language and culture.
Industrialization, the spread of education, newspapers and literature spread political awareness among ordinary people, leading them to organise against autocratic rule. This political awakening is clearly visible in the unification of Italy and Germany, the various European revolutions (1830, 1848), and national movements in colonies (such as India's freedom struggle).
Thus, nationalism is not mere emotional attachment but the outcome of the political awakening of the people, which drove them to organise and struggle for their rights, self-rule, and national identity.