For short bursts, there are buffers on each port on the switch, so they can get a little behind and not lose packets.
If it is a managed switch, there may be a 'deferred packets' counter so you can see if it gets bad.
More long term congestion is combated by IEEE 802.3x, which has provisions for 'back pressure' feedback if a link is overwhelmed.
I have no idea how to detect that it is being invoked, though.
I tried to remain child-like, all I acheived was childish.