Few devices I know sold to consumers give any more than legally required here (which is 2 years on electronics - I am not sure how the details work out).
There are some economic ways to 'calculate' warranty, based on stuff like failure rate, cost of failure (hard to express - you lose more than just the device, also customer relations are damaged which is something you can't easily put a number on), cost lowering failure rate.
Another thing is that makes things difficult is how to measure failure rate. In a nice, 20C lab with automated equipment pushing buttons you might get 10000 cycles of your switch. Now give it to some kid that leaves it outside once or twice a month, smashes the button in all crazy manners, drops the item, etc, and suddenly your switch lasts 100 cycles...
Friend of mine works at an automotive company, and always says that a car with more years warranty will simply be given more years of warranty because they have a high confidence the car doesn't break down in the first place. Similarly, says that certain high-end manufacturers can afford to offer free 24/7 support ('get you going within 30 minutes anywhere you are in europe') simply because their cars don't break down all that often.