Biases in meeting opportunities have been recently shown to play a key role for the emergence of homophily in social networks (see Currarini, Jackson and Pin 2009). The aim of this paper is to provide a simple microfoundation of these biases in a model where the size and type-composition of the meeting pools are shaped by agents' socialization decisions. In particular, agents either inbreed (direct search only to similar types) or outbreed (direct search to population at large). When outbreeding is costly, this is shown to induce stark equilibrium behavior of a threshold type: agents \inbreed" (i.e. mostly meet their own type) if, and only if, their group is above certain size. We show that this threshold equilibrium generates patterns of in-group and cross-group ties that are consistent with empirical evidence of homophily in two paradigmatic instances: high school friendships and interethnic marriages.