Chemical understanding is driven by the experimental discovery of new compounds and reactivity, and is supported by theory and computation that provide detailed physical insight. Although theoretical and computational studies have generally focused on specific processes or mechanistic hypotheses, recent methodological and computational advances harken the advent of their principal role in discovery. Here we report the development and application of the ab initio nanoreactor--a highly accelerated first-principles molecular dynamics simulation of chemical reactions that discovers new molecules and mechanisms without preordained reaction coordinates or elementary steps. Using the nanoreactor, we show new pathways for glycine synthesis from primitive compounds proposed to exist on the early Earth, which provide new insight into the classic Urey-Miller experiment. These results highlight the emergence of theoretical and computational chemistry as a tool for discovery, in addition to its traditional role of interpreting experimental findings.