It is actually cheapest for poor people to have kids if you look at it in terms of opportunity costs. A poor person may not have a job or if they have one, it may not pay very much. So if they lose the job because they have to take care of a child, they lose little. A wealthy person loses all their income if they stay home to be with a child. That’s too expensive for most wealthy people.
In addition, in many countries in the world, children are your retirement plan. Male children, in particular. The more children you have, the better off you will be when you are old.
In parts of the world where there is poor health care, children die at higher rates. If children are you retirement and your wealth, then you need to have more, especially if you are poor. For poor people, children cost less than for wealthy people. They also provide more wealth. It is an economically sound decision to have many children when you have little wealth and it is likely you will lose many of them. It makes much more sense to have few children when they cost an awful lot and when they are unlikely to die.