Psychological group memberships as outcomes of resource distributions