Bad Omen

Bad Omen is a status effect that causes a raid to appear if a player with this effect enters a village boundary (any area with at least a villager and a door for Java Edition or with at least a bed for Bedrock Edition).

Causes
Killing more illager captains while the effect is still ongoing will stack the level up to 6 (VI).

Immune mobs
No mobs are immune. It is hard for them to actually obtain, though.