Ammonia is made from nitrogen and hydrogen. The nitrogen is extracted from the air, which is about four fifths nitrogen. The hydrogen is obtained from natural gas, which is mainly methane.
The two gases react to form ammonia, but the reaction is reversible, so ammonia can also break down into nitrogen and hydrogen again.
N2 + 3H2 ⇌ 2NH3
If the reaction takes place in a closed vessel, the forward and reverse reactions eventually happen at the same rate. The mixture has then reached a dynamic equilibrium. The vessel holds nitrogen, hydrogen and ammonia all at once, and the amounts stay constant.