What motivates human behaviour in social dilemmas? The results of public goods games are commonly interpreted as showing that humans are altruistically motivated to benefit others. However, there is a competing 'confused learners' hypothesis: that individuals start the game either uncertain or mistaken (confused), and then learn from experience how to improve their payoff (payoff-based learning). We: (1) show that these competing hypotheses can be differentiated by how they predict contributions should decline over time; and (2) use meta-data from 237 published public-goods games to test between these competing hypotheses. We find, as predicted by the confused learners hypothesis, that contributions declined faster when individuals have more influence over their own payoffs. This prediction arises because more influence leads to a greater correlation between contributions and payoffs, facilitating learning. Our results suggest that humans, in general, are not altruistically motivated to benefit others, but instead learn to help themselves. Humans often face opportunities to improve group welfare but at an individual cost ('social dilemmas') 1,2 . For example, an individual may act to pay more taxes, practice social distancing during a pandemic, and/or reduce their carbon footprint 3,4 . Human behavior in such situations is often studied experimentally with the public-goods game 5-7 . In the linear public-goods game, individuals can contribute financially to a group fund, which multiplies all contributions by M. The total product is then shared out equally between the N group members, providing each individual a return of M/N per unit contributed, termed the marginal per capita return (MPCR). Consequently, whenever the multiplier is smaller than the group size (M