Adult pigs will randomly poop and it’s up to you to collect it. You can then use it as you would manure in the real world. It acts as a bonemeal substitute and a much more efficient source of food growth if you happen to be playing in a peaceful world.
And there are two other uses for the manure as well. You can smelt it into bricks or somewhat hilariously use it to dye white wool brown.