These could be the possible reason for this issue, you may check and verify these personally:
1- Cheap bulb.
2- Are you touching the glass of the bulb when fitting a new one? if you do accidentally touch the glass, clean the glass off with alcohol, nothing greasy. (the oils on your skin react with the quartz glass when bulb is lit)
3- Vibration in the bulb fitting holder.
4- Correct 'VOLTAGE' bulb is at12 volts. If the volts are increasing then bulb may blow off. Ther charging voltage at battery should be no more than 14.8 volts at battery.
5-Headlight bulb exploding would most likely be water in the lamp unit splashing on the hot bulb.
6-Headlight bulb imploding - Grease or oil transferred to bulb glass off your fingers.
7-A short circuit in the wiring,usually near the bulb fitting, due to the extreme heat the bulb socket/wiring can go brittle or (if fitted) relay.