You can reprogram the STM32 microcontroller in them[0]. It's a fairly decent Cortex-M3 processor and it additionally has WiFi and a few other features. Some people went an easier route and just watched for the ARP request the dash button would send[1]. $5 isn't bad but when you could buy them from Amazon, you'd get a $5 credit when you used it the first time, essentially making it "free" if you needed the purchased item anyway.
[0]: https://learn.adafruit.com/dash-hacking-bare-metal-stm32-pro... [1]: https://github.com/hortinstein/node-dash-button