I had a licensed electrician replace my main panel and also install a subpanel in my garage. At the time I knew nothing about electrical, and now I know just barely more than nothing. I have recently learned that the ground bar and neutral bar should be bonded. I have examined both my main and subpanels and determined my bars are not bonded. Should the ground bars in both my main and subpanels be connected?
Neutral and ground should only be bonded at the service equipment. This could be at the service drop, the meter, or the service disconnect (250.24(A)(1)).
Looks like the neutral is bonded in your main panel, via the bonding screw.
The second panel is then fed using four wires, to keep ground and neutral separate.
It's a trade of as far as safety goes. If the ground is bonded to neutral, and there is an an open neutral situation, or lightning strike, or utility transformer primary to secondary short, all your grounded appliances like washing machines and pool pumps can become live with dangerous Voltage, since your ground rod or water pipe likely has too high of a resistance to keep the Voltage at a safe level. On the other hand, double insulated devices would be safer if someone is using one.
The best solution for safety, especially if you have a pool pump or other grounded appliances where people are frequently in contact with them, is to put in a separate ground rod somewhat far away from the other one and use one for neutral ground and one for ground ground. Now you have the advantages of bonded and non bonded ground at the same time. Now nobody dies stepping out of the hot tub when the 7.2kV utility line shorts out and contacts your 120V service drop.