There are a few situations where a sub panel must be bonded. Rare, but one example is an unattached garage wired before the 2008 NEC with 3 wire cable & no metal connections (pipe or conduit) to the house. A ground rod was driven & the panel bonded.
No longer allowed - 4 wire cable is now required (although some authorities still require a ground rod at the panel attached to the ground (not bonded to the neutral).
The rules for bonding/grounding are complex enough that the
Mike Holt Forum (a good source for US NEC info) devotes an individual section to it.