They have always been expensive, and they have never been as expensive as today.
More than any other resource, babies require time. Talking purely from a US perspective, inflation adjusted income has never been higher.
https://fred.stlouisfed.org/series/mehoinusa672n
When we earn more, the time spent to care for a baby 'costs' more because it's time not spent working. It's time not spent continuing your education. It's time not spent doing some expensive bougie luxury like paying someone else to cook you a meal.
It's a similar reasoning as to why working hours have only dropped a bit. When we earn more per hour, we can afford the same quality of life with fewer hours worked. However it also means each hour we choose not work is costing us more in opportunity cost. So we choose to work more.
Still, considering how many years we spend in education with little to no employment, and how many years we are currently able to live after we have retired, the % of our lifetime spent working has never been lower.
For much of history people would often have children to work on farms and support the parents when they're older. Sometimes this support system was nuclear. Sometimes it was broader in society. So how do you account for "expensive" here? I honestly don't know.
But a lot of people focus on more modern times, particularly post-WW2, because the trend here is pretty much straight up. Education, housing and medical expenses have far exceeded inflation and real wages.
In more developed Asian countries (eg South Korea, Japan, China) the number of children has gone down in part because it is so expensive. In South Korea, so much is spent on tutoring to get into a good university to get a good job. The entire family's income is devoted to that. In China, for a man to be marriageable he often needs to pay the bride's family, have property, have a good job and so on. China has actually tried tackling some of this by popping the real estate bubble and outlawing private tutoring. Still, competition is intense and the bride price is still very real.
I think about the Fermi Paradox. What if the answer to why there are no galactic civilizations is as simple as "because capitalism"? Birth rates in developed countries are generally falling off a cliff as the barrier-to-entry gets increasingly higher.
That wouldn't make any sense, because if it were true then we wouldn't have seen the population explosion take off under a primarily dominant global capitalist economy in the first place. The ability to distribute goods and services in a decentralized way and accompanying technological advances which are supported by market opportunities focused on profit have paved the way for the 8+ billion people on the planet who are almost all living in much better conditions than most human beings throughout history.
With respect to birth rates I believe there are a lot of factors at play, but one which is perhaps the largest is the substitution of the family unit with the state. Even as little as 100 years ago we were a lot more family-oriented with much of that seeming to dissolve recently. We don't need a child or 5 to take care of us when we're older, we have a 401k and an HSA for that. There are pros and cons there.
The mix of factors influencing declining birthrates I would argue depend on the country. South Korea is a homogenous country of 50+ million about the size of Indiana. There are too many people for too few opportunities and everyone wants the good life. That's why people are spending their life savings on tutors for their children, unlike the United States perhaps where while we have quite a number of people living we are the world's most diverse country and here we have (for now) enough opportunity for folks to pursue careers, start new businesses, and such.
Automation notwithstanding, a 401k and HSA merely represents a portion of labor from someone else’s child(ren).
But I think that it's still different from having kids who help you. The 401k (and similar style schemes) are primarily a western phenomenon. Without them we'd have to have a lot more children, I think.
It's culture. We (in the west) have created (and exported) a culture that undermines the family and family values, tells people there's things that are more important (or in the past, that kids were to be actively avoided), and then we try to talk about dollars instead when that leads to what it has. That reveals part of the problem; our hearts are focused on money, not the family, but money isn't the problem, we are.
Although, perhaps it could be better framed as the short term expense was not accounted for, whereas now, the long term expense is not accounted for.
Short term being less than a few decades and long term being more than a few decades.