So I think there's a genetic predisposition to them, probably to varying degrees.
I've had three in my lifetime, the first one when I was younger than TWO YEARS OLD! That hernia bulged into my scrotum! I don't remember it, but my mother and older siblings realized that something was seriously wrong because I was crying so loud... and they said that I almost never cried about anything. (Which made me a popular baby in the family, since they had anticipated lots of interrupted sleep.)
I later learned, about four decades later (!!), that my oldest brother was balancing my belly on his head as he held my arms and bounced up and down! He said that I was laughing as usual, but then I was suddenly shrieking and so he quickly placed me back in the crib!
So I said, "Holy crap! So that's what caused that hernia!", and he got angry at me for even suggesting it! "Don't you DARE try to blame me! It was only a coincidence!"
(And then I dropped it.)
Anyway, I had two more hernias as an adult. Surgeries were done each time, with mesh inserted to prevent it from happening again. And it's indeed never happened to me again.
After the last operation, the surgeon said, "You didn't tell me about your hernia from when you were a baby."
Me: Oh, I forgot! HOW did you know about that?!
Him: I saw the tiny scar inside of you, from the operation that clearly must've happened when you were a small baby. Anyway, I wrapped the mesh down there too... to help prevent another hernia that might protrude into your scrotum.
Me: THANK YOU! THANK YOU!