"As a trivial example, someone needs to pay the author, which is typically done through royalties. But the publisher also needs to get paid, as does anyone the publisher employs."
Any time someone is paid based on the number of units sold (e.g. royalties), sure it is. If I sell one more ebook, I need to pay out more royalties, and therefore my total cost has gone up.
I realize I'm handwaving a bit, but my basic point is that selling more ebooks is not free for the publisher. There's definitely a cost here. And it's somewhat tangential anyway, because the marginal cost that's important here is Amazon's. In the traditional model they buy ebooks from the publisher at a fixed price, just like with physical books, and then mark them up and resell them. So the marginal cost here is the amount they pay the publisher per copy.
Those aren't marginal costs.