I guess that's part of it. Products as
are insanely expensive. However, development boards for ESP8266 like Wemos d1 mini cost less than 1 buck, if you add a plastic enclosure, a snap button and a coin battery it should cost less than 10 bucks.
But it's true that amazon could be actually losing money when they deliver the buttons. They just make up for the loss after a couple of button presses.