What does the “hero of the village” enchantment do in Minecraft (you get it by defeating a raid)?
Pillagers are hostile mobs that set out killing villagers.
As such, defeating a raid is directly saving the villagers, and thus a hero of the village effect is activated, giving cheaper trades for any village while it lasts
Level I Hero of the Village decreases the cost of the first item in a trade by 30%; each additional level decreases the price by an additional 1⁄16 (6.25%), up to the 55% discount with a level V Hero of the Village. No matter how large the discount is, the final item count in the trade is always at least one, never zero.
Source:Official Minecraft Wiki.
Also in java, this effect applies to all villages whereas in bedrock only the one you saved from the raid.