As I understand it, there's lots of problems with things like this, and that's one of the potential issues, but I would imagine that this mostly uses raised beds with clean soil brought in from elsewhere.
We thought about doing some gardening when we had a backyard in an apartment in New York, but even grass wouldn't grow in that soil - it didn't help that the soil was littered with debris like glass, concrete, random bits of metal, etc.