Contact with members of one's own group (ingroup) and other groups (outgroups) shapes individuals' beliefs about the world, including perceptions of discrimination against one's ingroup. Research to date indicates that, among members of disadvantaged groups, contact with an advantaged outgroup is associated with less perceived discrimination, while contact with the disadvantaged ingroup is associated with more perceived discrimination. Past studies, however, considered ingroup and outgroup contact in isolation and overlooked the various processes that could explain these associations. We addressed these issues by examining whether disadvantaged-group members' perceptions of discrimination are shaped by how much contact they have with ingroup and outgroup members (contact effects) or by those ingroup and outgroup members' perceptions of discrimination (socialization effects) while controlling for their tendency to affiliate with similar others (selection effects). Three studies (total N = 5,866 ethnic minority group members) assessed participants' positive contact, friendships, and perceived discrimination and applied longitudinal and social network analyses to separate and simultaneously test contact, socialization, and selection processes. In contrast to previous studies, we found no evidence that contact with members of the advantaged outgroup precedes perceived discrimination. Instead, we found that friendships with members of the disadvantaged ingroup longitudinally predict perceived discrimination through the process of socialization-disadvantaged-group members' perceptions of discrimination became more similar to their ingroup friends' perceptions of discrimination over time. We conclude that perceptions of discrimination should be partly understood as a socialized belief about a shared reality.