These rovers are built very well but Mars is tricky - a little dirt where it shouldn't be or a tiny computer glitch and it's toast. For instance Opportunity's sister rover got stuck in 2009. So I imagine NASA expected the rovers to last longer than 90 days and were prepared for that, but it's also a bit of a coin toss whether the machinery will last 3 weeks or 13 years.
https://en.m.wikipedia.org/wiki/Opportunity_(rover)