They could do whatever they're doing with their tech workers. Around these parts any talk of unionizing developers is usually meet with skepticism or derision. So whatever big tech is doing is keeping most of their tech workers happy and unwilling to unionize.
They could do the same for their warehouse employees, but that would mean paying them very well and giving good benefits.
Nobody is asking that warehouse workers or store clerks be paid ridiculous amounts like $120k/yr, a fair liveable wage will do, failing that a lot of the problems would be resolved if such companies scaled back whatever policies they have that lead to news stories like Amazon workers peeing in bottles because they can't take toilet breaks, but as neither of these things happen you get exploited workers who naturally want to unionise.
It's also not that feasible to pay developers $120k/yr as the rest of the world has found out, America manages it for a number of reasons and because of this you likely won't see developers unionise any time soon even if you guys do have some very questionable contracts.
But it could be feasible to pay them more than a poverty wage. Something where working full-time would reasonably cover housing and food costs (and ideally healthcare as well) without needing government assistance.
That's not really my point. My point is that workers wanting to unionize is not some inevitability that Amazon must be forced to deal with. If their workers are happy they may not want to unionize. I think it's telling that white collar tech workers generally are against unionizing while Amazon's blue collar workers are trying to. So you have workers in the same company, some who feel that it is unnecessary to unionize and some who feel it is.
They could do the same for their warehouse employees, but that would mean paying them very well and giving good benefits.