I had a sudden burning urge for a child at 39, after being ambivalent about it for years (as was my DP). Suddenly I was staring at babies and toddlers on the train, longing for one of my own.
I ended up getting pregnant via IVF shortly after my 40th birthday with DD, now 2. We have a frozen embryo left over from the cycle, but I'm not sure if I want to try for another, as being an older mum to a toddler is exhausting! I adore DD and am glad I had her, but am not sure if I'd cope with two. My cousin had three kids in her 40s and every time I see her she looks frankly haggard - like she has aged 15 years in 5 
I don't know what causes this baby panic except, as others have mentioned, a realisation that the window to become a mother is about to close for good. Because throughout our 20s and 30s, it's always a possibility, something that we can do, if we want to (even if we don't want to). Maybe there is also an element of panic about mortality and aging - many people have kids in order to give their lives meaning and direction.
What clarified things for me was reading an excellent piece on this issue from a woman who, after making the decision to try for a child with donor sperm at 39, found out she was too late. She goes into the reasons why she wanted a child in the first place and how she came to terms with the realisation that she wouldn't have one.
phonaesthetica.com/2014/07/06/i-am-my-own-wreckage-i-am-my-own-black-box/
It's a really incisive meditation on the meaning of motherhood and children in our lives.
The first lines cut me right to the bone, as a then-childless 39-year-old myself:
Last week, I became someone who never had children.
Before then, I was someone who simply didn’t have them.
I realised that I didn't want to be someone who never had kids. It's not particularly rational, and I'm sure is at least partly due to my internalising social messages that say women cannot be properly fulfilled unless we become mothers, which intellectually I know is not true. As the author says:
I’m not bothered by people who say I’ve missed out on the Most Important and Profound Thing a Woman Can Ever Do, because deep down I don’t think that’s true. The idea is unimaginative and misogynist across the board. Important and profound, for sure. The be-all and end-all of female existence? No.
I love the part at the end where she talks about how a child cannot give your life meaning - only you can do that.
I can’t transfuse the meaning of, or the answers to, my own life into someone else’s, whether I’d had kids or not. I can’t recuse myself from the task of meaning- and answer-making. No one else can be the black box in the middle of my wreckage.