All other apes are at least somewhat similar in dimorphism, with the males being stronger and larger, presumably for competing with other males. Lest we forget, chimpanzees, our nearest ancestors, literally go to war against rival tribes, with groups of males going off to kill and sometimes eat the children of others tribes and abduct their females.
https://www.youtube.com/watch?v=a7XuXi3mqYMGoing back to early, pre-modern humans, as nursing women would be unable to go on the hunt (or scavenge, as is theorized for early man, to explain why we are built for endurance running), it makes sense that men would become more built for offensive roles requiring strength, while women would be more built for defensive roles in order to defend her young in the men's absence. This builds into how men and women interact, with men using competition and banter as part of bonding, and women using other bonding mechanisms geared towards reducing open hostility. Women are far less able to escape from peers while they're stuck back at camp with child, while a man that isn't getting along with his hunting party could just fuck off for a few days and come back when he's chill. Really, just watch Mean Girls to get a feel for how women establish hierarchies and solve disagreements differently from men.