Thanks for the tag. In ancient hunter-gatherer clans the children were raised and provided for by the tribe, and to a large extent that still takes place. The Na of China have a current culture based around the matriarch, and all children are raised by their mother’s family, including their uncles and older brothers, but not their biological fathers.
But even in early agricultural societies, descent was matrilineal, and so sexual fidelity and knowing who the father of a child is, was irrelevant. A man wasn’t providing for children that weren’t biologically his, because we didn’t have that same notion of “providing for.” These communities were highly egalitarian and cooperative. There wasn’t any of the class stratification that came later with patriarchy.