Protect exposed metallic components from ESD
Any conductive object that is externally accessible can be subjected to a ESD strike by handling it. The most common example if the situation you describe, the metal shielding on connectors. 

As good design practice, connector shielding should always be connected to ground via a resistor (usually 0 ohm) so that if ESD or ground loops are a problem, you can add resistor or disconnect the shield without a board respin. There are of course a few exceptions where this effects the signal intergrity and should not be done, but thats more for RF stuff.

It's quite common as well to join connector shields to ground via a resistor and a cap in parallel (something like 1Meg and 4n7). If you look at USB or Ethernet PHY datasheets, they quite often suggest this.

Also as a side note, connectors on the device end (i.e if you design a USB device that connectors to a computer), should not have the connector shield connected to the board ground if they have their own power supply. This isn't for ESD reasons, it's to prevent ground loops.