The 2 often feed off each other too. E.g. men are slightly stronger than women, on average. Men are then expected to take on the strong protector role, while women are expected to act weak and subservient. This amplifies the original slight difference massively, reinforcing the social stereotype.
Women seem to have a preference for cooperation, with their ranking within the group mattering most. Men seem to err towards intergroup competition, where your teams ranking matters most. These necessitate different types of social skills, which feeds the stereotype, which feeds the original difference.