My understanding is the waste gets resequenced and used to create other items.
* Enterprise - S1E8 Breaking the Ice
> Tucker: The first thing you've got to understand is we recycle pretty much everything on a starship. That includes waste, and the first thing that happens to the waste is it gets processed through a machine called a bio-matter resequencer. Then it gets broken down into.
> So the waste is broken down into little molecules and then they get transformed into any number of things we can use on the ship. Cargo containers, insulation, boots, you name it.
* Discovery - S3E12 There is a tide...
> Admiral Charles Vance: It's made of our shit, you know.
> That's the base material that we use in our replicators. We deconstruct it to the atomic level and then reform the atoms.