Late Heavy Bombardment
It has been postulated that carbon from a cascade of asteroids (known as the Late Heavy Bombardment), resulting from interaction of Jupiter and Saturn, blasted the surface of young Earth and reacted with nitrogen in Earth's atmosphere to form HCN.