Honestly, I don't know, I think it can vary from person to person.
I'm mid fifties and lost my dad to cancer when I was 30 (he was 60) and MIL a few years earlier when she was the age I am now. Both events were obviously extremely sad but neither triggered the severe health anxiety I was to suffer from in more recent years. DH on the other hand had awful health anxiety in his 20s, likely triggered by the death of his mother, but is mostly OK now. We then lost a close friend when we were all early 40s. Again, very sad but I remember thinking how unlucky he was and feeling grateful for my life and health.
However, a few years later I had an actual health scare and googled my way into cancer (which I didn't have) but it caused me to be anxious about health ever since. It got much worse as I entered my 50s and menopause, I think due to the fact that cancer is more likely as you age. I've noticed that doctors seem more concerned the older you are ("because of your age I'll refer you"). Arghhh. Then of course there's all the screening tests you get offered, obviously a good thing. I don't think social media helps and all the awareness campaigns, and of course having Dr Google at your fingertips!
I was at my worst a couple of years ago but after CBT a bit better now. My anxiety isn't just about myself but those close to me, especially my adult son for some reason, I freak if he has the slightest thing wrong.
These days I try to keep busy and enjoy whatever healthy life I have left but it is hard sometimes and easy to drift into a Google rabbit hole if I get triggered by yet another minor symptom or hearing yet another cancer story.
Finally, I think some people are more predisposed to health anxiety than others. My sister is the most chilled person I know and will occasionally nonchalantly mention a health issue or medical appointment for her or one of her family while getting on with her busy, social life. Things that would have me worried sick. However, she's of the attitude of not worrying until there's actually something to worry about which, to date, there hasn't been!