Why such analog comparator input setup?
The junction of R3 and R4 can be (should be) regarded as producing a fixed DC voltage of Vcc/2. C2 smooths any AC ripple on this voltage keeping it free from variations injected by the input signal via the 100 k resistor (R2).


  But what I don't understand is it has a 100k resistor (R2) connecting
  both inputs. What's the purpose of that?


No, R2 just takes the Vcc/2 bias and applies that DC level to pin 7 so as to roughly centre pin 7 in the middle part of the range of the comparator's input.

R5 also couples Vcc/2 to pin 6 thus biasing pin 6 at Vcc/2 BUT pin 5 can modify that bias point via the 1 Mohms resistor R6.

I don't know where the circuit is used or for what but it looks like some kind of data decoder where the unknown data enters as the "signal input" and pin 5 is used (possibly at a high frequency toggle rate) to adjust the comparator trigger point.

If you can supply more details then I'm happy to fill in other gaps.