Consider the value of relationships. Taking just your immediate family unit initially, if you're on your own, you have no relationships.
P=1, R=0.
If you are attached, you have one relationship.
P=2, R=1.
Add a child
P=3, R=3.
And another
P=4, R=6. (You just doubled the number of relationships by adding a second child).
Add a third
P=5 R=10. (That's quite a lot of relationships!)
Now consider that actually a relationship between two people not one single thing. It's experienced differently, but equally, by both people. So count each relationship twice.
P=1 R=0
P=2 R=2
P=3 R=6
P=4 R=12
P=5 R=20 etc.
You can take it further and consider the further combinatorial effects of considering wider family relationships. Aunts, Uncles, grandparents, cousins, etc.
And you can consider the number of unique relationship types created, especially when you factor gender. Mother-Son, Mother-Daughter, Father-Son, Father-Daughter, Brother-Sister, Brother-Brother etc etc. This is often what drives people to go beyond three children. "We really want a daughter" or "We really want a brother for Peter" etc.
Also (sadly) you can think about the inevitable loss of relationships, through the inevitable death, or even serious relationship breakdowns. The relationships in a small family unit can be devastated by an event.
It's easy to see why many people stop at 2, but also why many people go for a third or more!. You get a lot of "bang for your buck"!
But there is no "right answer", no "ideal" family, and myriad other factors to consider.