Sometimes the terms bonding/grounding/earthing are used interchangeably. This is confusing (especially when viewed from different countries/languages). Bonding typically refers to joining one of the current carrying conductors with the 'ground'. Within this context, 'ground' is a reference plane, typically at 0V, and which serves as a means to carry a fault current. When the fault current occurs, a fault current detection device is used to switch the current off. This prevents that metal parts become energized.
For this reason, all metal parts are also connected to this reference plane, and thus are at the same potential. Any live conductor that comes free (e.g. through vibration) and tries to energize a metal part (e.g. an enclosure) introduces a fault and will thus trigger the fault detection device.
If the metal part would not be 'grounded', the part could become energized and can lead to a dangerous situation. Now bonding a current carrying conductor to this ground plane (i.e., your Neutral at the fuse box) makes it so that a fault current can actually flow: if it is not, and e.g. the live conductor connects to the metal enclosure, there still isn't a way for the current to flow back to the source unless the Neutral is connected to the ground plane.
For this reason, metal parts (solar panel frames, inverter housings, etc) should always be connected to this ground plane. However bonding one of the current carrying conductors to ground is not always required: with solar panels, if you don't, you get what is called a floating installation - and these have been the default in Europe since forever. The requirement with doing this however is that you have to have a double pole breaker (interrupting both + and - of the panels) and (in some countries like Australia) a dedicated fault detection device or is part of the inverter it is connected to. For the US specifically:
"An ungrounded PV array, as permitted, per 690.41(A)(4), is where neither of the dc conductors from the array is grounded, which is the most popular of all the array configurations in the U.S. today. In such a configuration, it is especially important to provide ground-fault protection because there would, otherwise, be no way of detecting a ground-fault in the array, which underscores the importance of the GFPD’s functions in a solar PV system." - you can find that in the link
@Partimewages posted.
Also note that just adding a grounding rod is usually not enough, because the impedance gets to high (soil is not a good conductor) and in that case a connection has to be made from the ground rod to the main earth connection. This is somewhat different in a TT network with European style whole system ground fault detection devices which tend to detect small current leaks, and don't rely on a breaker with higher current going through the fault link, but that's for another discussion...
TL/DR: metal cases and solar frames/arrays are always connected to ground. Current carrying conductors are sometimes bonded to ground - check your local requirements and ask a professional in your area.