Photosynthesis
Photosynthesis is not an accident. It happens because its building blocks occur naturally in space, and get included when planets form. We have no idea as to how common or rare this process is. We do know that higher elements are formed in supernovae, and that is the origin of all elements higher than helium. The higher elements found in Halley's Comet have been analysed.