Looks aftermarket. If the factory shipped a YJ with AC, it had it hooked up to factory connectors. That was different depending on year, later models like 92-95 I believe had a pigtail under the dash to connect to. Doing so allowed the engine computer to run the AC so it could control the idle speed too for smoother operation. I don’t believe 87-90 had any such thing, they all hooked up power to the fuse box no matter what as far as I’m aware.
However, the factory wiring would be that pressure switch connector you pictured. I’m not sure where else a factory AC unit would have hooked up to that, somewhere under the dash probably. But that connector is 100% for a AC pressure switch. The pressure switch would be mounted on the drier.
Some aftermarket ACs (including the one my YJ came with) literally just apply power to the compressor lockup as soon as you turn the blower on. Didn’t have a pressure switch at all. But that’s aftermarket. If it was factory it would have utilized the switch and that connector.
As to why your specific compressor is not kicking on….look around the drier and see if a pressure switch is mounted to it. If not, you don’t have one which would mean your compressor should kick on as soon as you turn the AC on and off when you turn it off. In that case, it not functioning properly probably means a bad switch or broken compressor wire. If you DO have a pressure switch AND that is aftermarket AC (likely), then you probably have a separate wiring harness that interlocks the compressor. Meaning maybe bad pressure switch or bad harness for it. But if you don’t have a pressure switch then you can weed out that possibility and focus on the compressor power wire coming from the AC unit.
The compressor should be case grounded so it’s probably a single power wire running to it.
my After market has same dash evap, blower there, I installed mine. (all)
mine has high/low switch right fender on top of receiver driver unit.,(see photo mine) yours is different model A/C)
all cars made , have extra connectors. for things not opted day one new.
no maker of car makes hundreds of harness versions for all permutations of options, (huge) (imagine the cost of that, making ,storing it)?
so all have connectors doing zero. on all cars made, never once did I ever see an exception. unless you ordered the car with all options. nah...
just safe them off. (tied back) as they did day one new.?
some AC back then was the dealer option installed. so one more variance there.
also the free service manuals cover all wiring, every inch and the colors of the wires. making connectors loose easy to ID. (unless hacked or some aftermarket things stuffed in) after 36 years, stuff happens.
seems yours is 2.5L TBI injected. TB there has the funky idle IAC mess. so. is.
see the A/C compressor, see the 2 huge hoses. the condenser, up front goes to the receiver dryer, and the switch.
mine is very powerful A/C even on 110f day
Good luck making any 36 year old car run good. (lots of work it is)