Some 4 billion years ago, the Earth was largely covered by a huge ocean. This ocean contained a large number of small organic molecules, which are called “prebiotics” because they were there before life appeared.
What were they? Were they synthesized on site or did they come from space?
How did they bind to form long polymers, some of them carrying genetic information, others working to reproduce all the basic molecules and then aggregate them into polymers?
Nothing was certain in advance! The polymers were not stable, the bonds were difficult to create. Yet here we are.
It is therefore good that a chemistry of extreme subtlety found the energy and time necessary to set itself up.
This video gives some hints to try to understand what may have happened.