You can get a hernia at any time, doing any activity.
If there is a weakness of any kind in the abdominal wall, it's just a matter of time before the weakness becomes a tear, and you now have a hernia.
I'd done deadlifts, squats, and lifted heavy for years. Jumped off the top row of bleachers leaving my high school basketball games.
One day I'm at work pulling a weed from a dry bed of dirt, and feel lightheaded. Stand up and regained my balance and everything is fine. Go home that night, and I have an inguinal hernia.
You can get a hernia from a sneeze, or a cough. I was born with my abdominal weakness, and the aforementioned activities apparently didn't have effect on my abs, yet pulling a weed did.