You say "hid" in your description. The base of a HID bulb for the foglights is the same as the halogen bulb base. So if you did, in fact, install HID bulbs without a ballast, they caused the failure.
An
electrical ballast is a device intended to limit the amount of
current in an
electric circuit. A familiar and widely used example is the inductive ballast used in
fluorescent lamps, to limit the current through the tube, which would otherwise rise to destructive levels due to the tube's
negative resistance characteristic.
Ballasts vary in design complexity. They can be as simple as a series
resistor or
reactor,
capacitors, or a combination thereof or as complex as electronic ballasts used with
fluorescent lamps and
HIDs.