By code the Neutral is only permitted to be connected to ground at one point and that one point should be in the main electrical service panel. Now the code reuuires that the sub panel cabinet be connected to ground via the ground wire from the main panel and also via a #6 or larger copper wire to the ground rod. It wouldn't hurt to also connect a #6 ground wire from the panel ground to a clamp on any nearby metal water pipe, if one exists. Telephone, cable TV, and other electrical services should also be ground connected together, at least at one point on the property.
Before the code required that a sub panel in an out building had to be grounded via a separate ground rod, a 60' pine tree next to my shop was struck by lightning (3' away). It was such a large strike that the top 16' of this pine tree was blown off and fell to the ground. The lightning also jumped from the tree trunk into the metal face of the door and then up from the top corners of the door through the 1/2" plywood sofitting above the door into the armored electrical cabling above the door (blew 1"X6" slots through the plywood). Although the electrical panel in the shop was grounded via the service cable from the shop to the main panel in the house, at the time I didn't have a separate ground rod installed at the shop, as it wasn't required by code. The ground connection via the electrical cable to the house aparently wasn't sufficient to carry the lightning load because the lightning jumped between the ground and neutral in the sub panel in the shop and went back to the main panel in the house that way too. This resulted in a large burn mark in the sub panel and burns between neutral and ground in many of the electrical outlet boxes both inside the shop and the house.
Four days later, while I was just sitting in the shop looking at some plans on my workbench, the receptacle directly behind my radial arm saw suddenly threw sparks and set fire to the wall around it. Nothing electrical in the shop was running at the time, except for the overhead lights, which are on a separate circuit. It's a good thing that I was there. I was able to quickly shut off the power and use an extinguisher to put out the fire on/in the wall. If I hadn't been sitting there when this happened I would have lost my whole shop.
After this incident I replaced many of the outlets in my shop and in my house, personally inspected all of them, and added a ground rod to my shop panel wiring. I now frequently take the time (at least once every spring) to check to be sure that my phone wiring, my cable TV wiring, and my house electrical panels are all ground connected to each other and to the ground rods. When I make this check I remove, clean, and replace any connection that appears not to be perfect.
I have always had a significant respect for lightning, but this incident enhanced this respect significantly.