That's the vacuum hose system that operates the front axle disconnect. It's supposed to start at the intake manifold, go across the firewall over to the battery where it heads down and splits to the transfer case and front axle.
Your previous owner deleted that system and put on that cable front axle actuator and left the hoses dangling. You can remove all that tubing all the way back to the engine and then just cap the port at the engine.
I got rid of that system long ago, though I did not replace with a cable setup like your PO did. I got rid of the front axle disconnect entirely.