Nationalism is known to mean having extreme pride in one's country. Imperialism means increasing power of a country through military or police action. By increasing pride and military force, a country can seem like they can do anything. When foreigners come in, they do not appreciate it as much and they have the power to exert brutal racism to these people due to their extreme pride and police force. Hope this helped :)