On the Origins of Gender Inequality