MIDI consists of a ring of cables, with a transceiver between each cable inside each device. The transceivers physically separate the two cables, meaning that signals not intended for that device have to be re-sent onto the output line. This introduces a delay, one that is long enough to become audible on larger MIDI rings.
The MIDI-THRU port avoids this delay by linking the THRU port to the MIDI-IN socket directly. The MIDI-OUT port is then used entirely for signals originating in that device.