They set the bottom price, and if they are earning 2%-4% profit margins, then their costs increases will have to end up in either prices increases or them no longer selling the product.
The funny thing is that it is Amazon coming along and greatly increasing demand for labor (in conjunction with reduced supply of that type of labor) that caused all the other warehouse jobs and retailers to increase pay.
And I hope the labor continues making gains in their quality of life at work and pay, but I do not see this happening without an increase in prices for products (like we have already seen).
Paying 18$ for something your selling for 20$ is a 10% margin, taxes and CC processing fees are similarly inflexible. So if 2-4% of the final price is profit then they could raise their internal costs by 10% and still be profitable.
They're not (depending on the product).
My wife used to work in Halloween costume design for a wholesaler (and some of her costumes did end up in Target and Walmart, which was cool to see), and the retailers' margins on those were at least 50%.
As I said, the margin does depend heavily on the product, but do not assume that across-the-board average margins are anywhere near that razor-thin.
They even know this - Amazon is running out of eligible workers to hire. But the need to hit quarterly metrics forces the line management to make strategically bad decisions.