On most of the PS/2 and other connectors similar to the mini-din, the socket that they connect to isn't as well aligned as it soululd be sometimes, and many times the connection is half-assed at best. When a cable gets moved slightly, the signals or power can be temporarily interrupted.
I don't know if damage will occur if short interruptions to power or signals can damage the keyboard circuit, or not. While damage may not occur with every interruption, I don't think that the keyboards are intended to be hot swappable devices.
I nearly always closely inspect the connector as it enters the socket/panel receptacle to feel and see how secure the connection appears to be, mostly to see that the cable plug seats firmly at the proper depth, not just barely making contact, but well enough to operate the device under normal operation conditions. Abnormal conditions may include anything moving around in the vicinity of the connection to the computer, or unsupported cable lengths. There are sticky-backed anchor pads with a loop for tying a cable down with a wire-tie which could be helpful in numerous applications where a hanging cable length places a considerable amount of strain on the delicate connector contacts.
I was making a couple of PS/2 plug modifications recently, and the pins are fairly delicate. The designations for mouse and keyboard pins are the same.. clock, data, +5V, ground and a shield (for the shell). I read that the +5V line for a mouse is typically fused, but the +5V line for a keyboard may not be. Two of the 6 pins are normally unused or reserved for a different pinout layout (sounds something like a $12 keyboard that sells for $120 because a generic one won't work).
Other aspects are generally always at play, thermal changes, vibration, roaming critters or something drops off the back of a desk etc.
For me, the easiest way to ensure that a plug connector can seat fully in the recepatacle, has been to trim away about 1/16" or slightly more of the molded plastic that makes up the plug body around the connector shell (tubular metal section) with a utility/razor knife edge pressed into the vinyl material, and rolling the plug like you would turn a piece of tubing to be cut, making sure that the sharp edge is cutting vinyl and not your skin. Slide off the O-shaped slice and see that the connector seats fully within the the panel connector. This trimming is especially helpful when the panel connector is slightly recessed and/or mis-aligned with the panel opening.