Sometimes they break....
Other times bits just randomly fall off.
Over the years I have had my fair share of mechanicals, even with the very best preparation the unknown can sometimes happen. A mechanical that ends up with a long push or carry, one that cannot be fixed on the trail. The most recent was when my front axle snapped on my beloved 11 year old Marin, in fairness it was the original WTB hub and probably well overdue for replacing!
I am competent with most aspects of modern day bike mechanics, hydraulic brakes, bottom brackets, headsets.... but I draw the line at wheel building and air shock servicing but thankfully I know a great guy who does not. James in essence is the owner of a "one man band" Bike shop called Bike Garage, I use him for bike hire and repairs and I highly recommend him.