A large and growing literature links high levels of ethnic diversity to low levels of public goods provision. Yet although the empirical connection between ethnic heterogeneity and the underprovision of public goods is widely accepted, there is little consensus on the specific mechanisms through which this relationship operates. We identify three families of mechanisms that link diversity to public goods provision—what we term “preferences,” “technology,” and “strategy selection” mechanisms—and run a series of experimental games that permit us to compare the explanatory power of distinct mechanisms within each of these three families. Results from games conducted with a random sample of 300 subjects from a slum neighborhood of Kampala, Uganda, suggest that successful public goods provision in homogenous ethnic communities can be attributed to a strategy selection mechanism: in similar settings, co-ethnics play cooperative equilibria, whereas non-co-ethnics do not. In addition, we find evidence for a technology mechanism: co-ethnics are more closely linked on social networks and thus plausibly better able to support cooperation through the threat of social sanction. We find no evidence for prominent preference mechanisms that emphasize the commonality of tastes within ethnic groups or a greater degree of altruism toward co-ethnics, and only weak evidence for technology mechanisms that focus on the impact of shared ethnicity on the productivity of teams.