a) they are DOING something bad: attacking, occupying, oppressing, blocking, so we need to stop them, kick them out, liberate from their oppression, break their block, etc.
b) they ARE (Jews, Christians, Muslims, etc., or a nation, or a group), and they are bad because (list of historical or invented reasons), so we need to kill or enslave them or force assimilation of them.
For example, recent Russian-Ukrainian war, from Russian side:
* Ukrainians are bad, because they are Nazi. Reasons: Ukraine is Nazi country because it is independent Nation, which is bad for Russian Empire/Soviet Union/Russian Federation. Thus: kill Ukrainians, close Ukrainian schools, magazines, sites, TV and radio stations, force Ukrainians to abandon Ukrainian culture.
* Ukrainian are oppressing Ukrainians, speaking in Russish. Reasons: nobody will speak in dumb Ukrainian language at their own will, when they can use Great and Mighty Russish Tongue (Великий и Могучий Русский Язык), so, obviously, Ukrainians are forcing Ukrainians to speak in Ukrainian language, AKA «forceful ukrainization»/«насильственная украинизация» (and Ukrainian language is dumb, obviously, because it causes laugh, when a Russish hear it). Thus: invade Eastern Ukraine to protect Russissh-speaking Ukrainians from forceful ukrainization (direct speech: «защитить русско-язычных жителей Юго-Востока Украины от насильственной украинизации»).
From Ukrainian side:
* Russians are invading Ukraine. Reasons: they want to destroy Ukrainian nation and make it part of Russian Empire/Soviet Union/Russian Federation. Thus: Ukraine must stop invasion.