USS2defiant gave some great info on the wiring there to fix up the wiring that goes behind the front bumper fascia. When my jeep was wrecked, this wiring was torn to pieces, so I didn't even bother trying to fix it. I found a factory replacement harness at a junk yard for $15 that already had the plugs for factory fog lights. Do yourself a favor and see if you can find a similar replacement yourself, as this harness powers the fogs, headlights, turn signals, and optional outside temp gauge. It all snaps into a channel in the plastic energy absorber that is sandwiched between the steel front frame section and the plastic front bumper fascia. there are lots of factory splices in it, so it's harder to tell what's factory and what's a hack job (that's why a recommend buying a replacement vs fixing), but the final connection to this harness is just behind the front grille (remove it for access) and right beside the driver side front headlight.
That main wiring harness in the U shaped channel that I referred to earlier should be firmly clipped to the bottom of the radiator support, instead of hanging down loose in the front bumper fascia. As you noticed, there's a ton of wires in there (most of that going to all of the engine/transmission sensors), so I would recommend you also find one of the "U" shaped plastic wiring shields from a donor car at a junk yard to attach this properly (it snaps around the wire bundle in 2 pieces). I had to replace this shield on mine (its $100 new, or $20 used) and snaps in place in less than a minute (if the bumper is off). It's way harder to install with the bumper installed, but it can be done if you bend it carefully, without breaking (installing from the bottom) and snap it onto the wire bundle (very difficult, unless you have small hands). You've got to consider that if a stone or some other small object hits that wire bundle at highway speed, you could easily get 2 wires in that taped up bundle shorted together and you may never notice it, and that will cause all sorts of problems to pull your hair out over.
morale of this story: 1) replace the harness behind the front bumper, and 2) very carefully inspect / repair the large wire bundle mentioned above and attach it properly, using the correct shield.