Bad Omen

Bad Omen causes an raid to appear if a player with this effect enters a village boundary (any area with a villager and a door for java edition or bed for bedrock edition)

Causes
Killing more illager captain while effect still remain will stack the level up to 6.

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