The emergence of large-scale irrigation systems has puzzled generations of social scientists, since they are particularly vulnerable to selfish rational actors who might exploit inherent asymmetries in the system (e.g. simply being the head-ender) or who might free ride on the provision of public infrastructure. As part of two related research projects that focus on how subtle social and environmental contextual variables affect the evolution and performance of institutional rules, several sets of experiments have been performed in laboratory settings at Arizona State University and in field settings in rural villages in Thailand and Colombia. In these experiments, participants make both a decision about how much to invest in public infrastructure and how much to extract from the resources generated by that public infrastructure. With both studies we find that head-enders act as stationary bandits. They do take unequal shares of the common-pool resource but if their share is very large relative to downstream participants' shares, the latter will revolt. Therefore for groups to be successful, head-enders must restrain themselves in their use of their privileged access to the common-pool resource. The comparative approach shows that this result is robust across different social and ecological contexts.