so i have a tree i put in a pot, covered with soil, and only ever added water to it. my tree's mass has increased, yet the soil has not lost any! by what magicks was water transmuted to bark, sap, and leaf?
Here's a nitrogen cycle diagram. It's not dissimilar to things like the water cycle or food chain cycle.
Practically speaking, you want to occasionally plant nitrogen fixing plants in your garden, as other plants will remove it from the soil. Lots of people will put tons of fertilizer into their garden, and that seeks to achieve similar goals.
The sky is full of nitrogen, some of them can grab it from there and others take it from the ground. I'm not a plant scientist, so I don't really know all the details