Why the growth of nationalism is linked to an anti-colonial movement.?

Why the growth of nationalism is linked to an anti-colonial movement.?