Applications of social identity theory to elections often assume candidates, especially those from marginalized groups, rely on identity-based appeals to mobilize ingroup voters. Yet, in reality, race and gender minority candidates do not always make identity appeals, nor do race and gender minority voters always support candidates who share their identity. We reconcile this discrepancy by analyzing strategic interactions between candidates and voters in a formal model of election that incorporates instrumental and expressive identity motivations. Our result shows candidate quality differential plays a critical role in explaining the levels of identity appeals. If a candidate has a quality advantage that is not too low and not too high, it can be strategically advantageous to reduce identity appeals, as such reductions are effective in attracting outgroup voters. The proposed model accounts for existing explanations of identity politics, such as group size, ideological position, identity strength, and within-group heterogeneity.