For many of us, the advent and wide deployment of birth control allows us to choose if and when we decide to procreate. Part of the downside of this is that we're often waiting until we're older before we decide to have kids.
It'd be inappropriate for me to comment on JL's age, but from experiences personal and nearby, getting pregnant has the potential to be stressful, depressing, and exciting. And at times it just doesn't happen.
Congratulations are in order because they've decided to take a chunk of their lives and time to take responsibility for another human being. And because the deep-seated happiness that comes from it is a gift worth congratulations.
I think it's a sort of "I'm happy you're happy" thing. Whenever I congratulate someone on having a child, I'm not literally congratulating them on having sex and spawning another human. That would be silly.
Although, there are many couples who can't get pregnant who would like to, so in cases like that, maybe literal congratulations would be in order?