The anatomy of social inequality