Employee referral programs, while efficient for the employer, have been shown to amplify sex-based occupational segregation in labor markets because of the tendency of workers to refer people of the same gender. We implement a controlled laboratory experiment that precludes any concern for network composition or reputation effects in referral choice. In this way, our experimental design allows us to disentangle statistical discrimination, preferences, and implicit same-gender bias. Our data suggest that women tend to favor women when choosing a candidate, whereas men do not attach much importance to the gender of potential candidates. We deduce from our various treatments that same-gender referrals are mainly driven by preferences in competitive environments and implicit same-gender bias in cooperative environments. Our findings add to the existing literature by highlighting that gendered networks alone fail to explain the observed gender homophily in referred-referrer pairs.