LEGALLY they don't have to
LEGALLY, they don't have to, because LEGALLY they aren't required to sell their wares to Amazon. If Amazon sets the price too low for too long, Apple may decide it doesn't like them undercutting their retail channel, and that of all their other resellers, so will cut Amazon off.
Typically companies that want to set a specific price will include some clause in the contract relating to such. And while that may or may not be legally enforceable, Apple could just decide that they're going to fill everyone ELSE'S orders before Amazon's. So if the supply of iPads is short, for example, Apple may decide that it'll fill orders for everyone else first, and then if there's any left over, those will go to Amazon.
If I make some product, I'm under no obligation to allow Amazon, or anyone else, to resell that product. If I sell to Amazon, I may insist that they follow certain guidelines. I may not LEGALLY be able to force them to do it, but I can certainly take their actions into account when I'm considering whether or not I want to CONTINUE selling my product to them.