While acts of war separate couples and would confound the analysis a bit, I think there is typically a big spike in births following wars. Baby boomers most notably being born after WWII. Optimism is dynamic and not a set threshold, wrapping up wars leads to new found optimism about the future. How terrible the recent past was is not all that relevant as it is about the trajectory.
If anything having a terrible past may make the bar lower for experiencing optimism, as it's easier to expect a better future when the overall bar is lower. Hopefully explaining that well enough and it's certainly not the only issue, but I believe we see the same thing on the stock market when large class action settlements are reached with a corp and the stock then rises as it is forward looking and optimistic now that the 'awful past' is settled. First-gen immigrants tend to have larger families as the impetus to move countries is an optimistic endeavor itself.
And while a reach, I think through this lens you can make an argument as to why lower classes tend to have more children than middle classes (currently in the US). It's easier to expect better for your children when you are at the bottom of the barrel (no where to go but up), whereas the middle class is in an increasingly precarious position.