The connection is direct: shingles is a late reactivation of the very same varicella-zoster virus that caused your childhood chickenpox. When you recovered from chickenpox, the virus didn't leave your body; instead, it became dormant and hid in your nerve ganglia near your spinal cord and brain. Decades later, if your immune system's surveillance weakens, the virus can reawaken. It then travels along the nerve pathways to the surface of your skin, causing the characteristic painful, blistering rash of shingles.
Having chickenpox does not guarantee you will get shingles, but it is a prerequisite. The lifetime risk for an adult who had chickenpox is estimated to be about 1 in 3. The primary trigger is age-related weakening of the immune system, which is why risk increases significantly after age 50. Other factors like significant stress, illness, or medications that suppress immunity can also contribute to reactivation.
The most powerful and reliable way to prevent shingles is through vaccination. The CDC strongly recommends the Shingrix vaccine (a 2-dose series) for healthy adults 50 years and older. It is over 90% effective at preventing shingles and is the single best step you can take to protect your future health.