XP is needed for mending your tools and armour, and XP farm makes it easier and automatic make you give the least amount of effort.
Enderman farms gives you unlimited ender pearls and easy XP as endermans aren't very smart.
Raid farms give off so much loo and XP, aswell as the Hero Of The Village title which discounts trading. Its suggested to do every month or so to resupply.
Cactus farms are by far the easiest farm in the game. its fully automatic and all you have to do is be in the radius so its on.