For a while Amazon loved selling the smaller units for a little as a dollar (and often including several months of Amazon music for free or almost free as well).
Sell enough of these 30 dollar gadgets for a dollar and it will add up quickly.
The Echo devices were sold for around BOM, but IIRC they were able to get some significant price reductions on that on a few popular devices, though I'm not sure if that ever got released. I think some of the newer devices might have turned a profit (not including R&D costs though).
Also, you need to count the server costs, including machine learning training and inference.