Typically the battery failures for cell phones and laptop computers that I have been reading about are either the result of cheap battery pack knock-offs or, in the case of Sony and manufacturing error that introduce impurities into the battery guts...
The batteries are failing by shorting--and these dead shorts internal to the battery cell itself are causing the batteries to catch fire and/or explode.
Other than checking for recalls and only purchasing name-brand batteries--there is probably not much you can do to cause or prevent one of these rare events happening to you (assuming that you don't cook or freeze the cells, mechanically damage, etc.).
-Bill