The main purpose of a wire harness is to provide a centralized and organized system for connecting electrical and electronic components within a device or system. It simplifies the installation, maintenance, and repair processes by eliminating the need for individual wires to be routed separately. Wire harnesses ensure proper and secure connections, enhance system reliability, and protect wires from damage or entanglement.