Obviously, when a merchant offers "free shipping," that does not mean that FedEx is carrying the package for free. That just means that the cost of shipping, whatever it is, is already factored into the cost of the product. Or, to put it another way, the merchant takes it out of their profit margin. Or, to put it another way, the price of the product is actually a bundle that includes the price of the shipping.
When web merchants lower their shipping costs, it's not because they found a cheaper way to get a mattress to your house... it's because they decided that telling a consumer that the mattress is $500 + free shipping sounds better than $400 + $100 shipping.
Merchants will prefer to offer low base prices and high shipping prices if consumers are not looking closely at the shipping costs. On the internet, almost all the good price comparison edges factor in shipping costs, so there is no reason to do this.
To contrast, look at airline tickets. Because the price comparison engines for airline tickets don't tell you about add-on fees for luggage, etc., the airlines prefer to quote low prices and then charge you extra for luggage.