They mostly developed because men did most of the work. Agrarian societies required hard work and toiling out in the field while pastoralism required people to take care of numerous animals at once and these animals often needed human strength and speed. Thanks to this, men were the ones who did those jobs and since they were valued more than taking care of the household, gender inequality originated.