Xp is gained by harvesting things like crops, or things generated by bone meal like grass or flowers. In general this skill is used to indicate experience gained by farming.
Perks of Leveling up Herbalism
Green Terra: This is an active ability that is activated by right clicking a non-dirt block with a hoe: This ability gives a chance to get 3x drops (this chance is based off of double drop chance) from harvesting plants. It also grants 100% chance using wheat seeds in the inventory to turn Cobble stone to mossy cobblestone, stone brick to mossy stone brick, and dirt into grass. This skill has a base of 2 seconds and gains an extra second every 50 levels of herbalism.
Greeen Thumb: This is a passive skill that auto replants the following crops: Wheat, Carrots,Potatoes, Nether Wart, and Beetroots. When replant will put it into a certain growth speed depending on herbalism level. This ability also includes the % chance with green terra on using it on blocks like cobble stone to mossy cobble stone, brick to mossy brick, and dirt to grass. When right clicking with wheat seeds on a block.
Shroom Tumb: Is the ability to turn a block of dirt into mycelium using red+brown mushroom. If you right click on it. The chance of this happening goes up with level with roughly 0.033% per level of herbalism.
Farmers Diet: Passive ability that grants extra hunger filled
Hylian luck: A passive ability whenever a sword is used to break grass, saplings, dead bushes, or flowers grants a chance to get melon seeds, pumpkin seeds, cocoa, carrots, potatoes, or apples. Each level of herbalism grants 0.01% every level. Up to a cap of 10% chance at level 1000 herbalism.
Breaking Grass,Saplings and Dead brushes with a sword will grant a chance to get melon seeds, pumpkin seeds, or cocoa. Flowers grant the chance to get carrots, potatoes, or apples.
Double Drop Chance: Simple passive ability that grants double drop chance per harvest. At 0.1% per level of herbalism. Caps at 1000 herbalism at 100%. To become a guaranteed drop chance.