What the heck is going on in this electrical box?
I don't think that's really burnt...

The closeup of the red wire linked in the comment does not appear particularly burnt to me (it'd be a quite strange spot to have a burnt spot, anyway).

The setup is good

What this setup appears to be is a new-style switch loop that provides neutral at the switch box, which is now required by the NEC (so that fancy dimmers/smart-switches/timers/... don't have to pull dumb stunts to power themselves).  The black wires that are nutted in the back of the box are the always-hots (incoming from the power source and outgoing to the switch), the red wire is the switched-hot coming back from the wall switch), and the white wires are all neutrals (incoming neutral from the power source and neutral off to the wall switch location).

One potential issue though

One thing I would check while you have this box open though is to make sure the grounds are made-up properly; the installer may have simply twisted the wires together without using a nut, which doesn't guarantee a proper connection.  I would take all those bare ground wires, untwist them, add a ground pigtail to a 10-32 self-tapper (Garvin GSST or equivalent) driven into exposed metal on the fixture (this takes care of grounding the fixture), insert them into the correct size wirenut, and twist the wirenut on, so that you have them properly connected from here on out.