Monogamy is a social construct that was born from the agricultural revolution. It was like an exchange of favors. The woman would commit to staying with one man for protection, shelter and food; the man, in turn, would know that all the children born were his.
Before this, everything was shared, including sexual partners. Sexual relationships were more liberal and equal, as they still are in some native tribes around the world.