Connector keying is a physical feature of a connector housing, such as a rib, slot or offset shape, that allows it to mate in only one orientation and only with its intended counterpart. It is also called polarisation.
A harness often carries several connectors of the same size close together, for example on a sensor bank or a control module. Without keying, two of them can be plugged into the wrong sockets, or a connector can be forced in rotated. The result is a swapped signal, a blown fuse or a damaged terminal, and the fault may not appear until the vehicle or coach is in service.
Keying is usually backed by colour coding and printed circuit labels, but colour alone is not a reliable control. The harness drawing should name the exact connector part number and keying code for every position. APAR's guide to harness labelling and identification covers how branches and ends are marked.