On the 97+, if you look at the oem HDLT (driver's side) plug you'll notice 2 wires going into the "hi" side of the plug.
One of those wires is the ground for the fog light relay. The fog light relay grounds through the HI beam element.
If you ground it to the frame, the foglights will come on when the fog light switch is on and the hdlt switch is on (both hi and low).
Now to make this thing work like stock, you need to splice that wire into the "HI" side of the aftermarket harness. Then the fog lights will come on with low beam, and go off w/ HI beam.
I have mine grounded to the frame, there are lots of deer out here in the sticks.