Part of it is that they are also gambling on you losing the receipt (or throwing it away) before it goes bad; I always keep my receipts for about 7 years for things like this that I buy, so I can take it back if it does die (or at least send it to the manufacturer for repair/replacement - if it is still under warantee). Most people don't, though. Of course, to counter people like me, a lot of places use these thermal printed reciepts that fade after a year or or so - no matter how well they are kept. For those, I scan them.
The other thing, which the designers of such products may or may not have any control over - is that they may specify a given component, but that component is sourced from a bad manufacturer. Right now there are a ton of products being made with a ton of bad electrolytic capacitors from various asian manufacturers (most in China); these caps are in tons of devices, from the most benign and common, to things people really rely on (I fear - I wonder - how many of these caps have made it into medical equipment). These caps have been a source of headache for many people - they leak, explode, burn, etc - in products and situations where you wouldn't think it would happen, but it does. The manufacturers (or at least the brand names - they might all be made by the same company for all anyone knows) are numerous - but if you do a search, you will come up with some names. Inevitably, if some device you own fails, and you open it up, and you've purchased it in the last 5-10 years, look at the caps first.
Ultimately, though, it comes down to us consumers and citizens insisting on a quality product first, instead of the cheapest product. Unfortunately, most people don't think this way (thus, Walmart)...