Customer orders X from seller A, A buys X1 from seller B, then A gives X1 to customer. Meanwhile B buys X2 from A.
Sellers can of course opt out of this scheme.
With FBA, you could have gotten counterfeit goods or a return from another customer where they've sent only the box and something that weighs the same (or a broken item). Amazon throws away the receipts (it'd be a nightmare to handle so they just... don't).
Why is Amazon not on the hook for this?
I'm not sure what you mean by this. Amazon does keep track on where a given unit came from so that it is traceable to the original source, and at least in Europe invoices are issued for the inventory supplies between the sellers (these are documented at https://sellercentral-europe.amazon.com/gp/help/help-page.ht... - may not be public).
Germany has so many other good online shops that it's for most products really easy to cut Amazon out and avoid that problem.