Scientists often perceive a trade-off between quantity and quality in scientific publishing: finite amounts of time and effort can be spent to produce few high-quality papers or subdivided to produce many papers of lower quality. Despite this perception, previous studies have indicated the opposite relationship, in which productivity (publishing more papers) is associated with increased paper quality (usually measured by citation accumulation). We examine this question in a novel way, comparing members of the National Academy of Sciences with themselves across years, and using a much larger dataset than previously analyzed. We find that a member's most highly cited paper in a given year has more citations in more productive years than in in less productive years. Their lowest cited paper each year, on the other hand, has fewer citations in more productive years. To disentangle the effect of the underlying distributions of citations and productivities, we repeat the analysis for hypothetical publication records generated by scrambling each author's citation counts among their publications. Surprisingly, these artificial histories re-create the above trends almost exactly. Put another way, the observed positive relationship between quantity and quality can be interpreted as a consequence of randomly drawing citation counts for each publication: more productive years yield higher-cited papers because they have more chances to draw a large value. This suggests that citation counts, and the rewards that have come to be associated with them, may be more stochastic than previously appreciated.