As some of the others have stated, gold comes primarily from the collision of two neutron stars, or from the final stage of a low mass star’s life. In the first case, a neutron star is a remnant of a high mass star that went supernova (exploded) in the past. Neutron stars are so dense they are on the doorstep of being black holes. When two are close to each other, they will orbit very rapidly, spiraling towards each other until they eventually collide. Some of their material (which is almost entirely neutrons) is thrown off into space, and this spray of neutron droplets thrown into space will undergo nuclear decay, becoming heavy elements. The decay of neutron droplets to form heavy elements is a type of [r-process](https://en.wikipedia.org/wiki/R-process).
In the second case, at the end of a low mass star’s life, it may under go a phase known as the asymptotic giant branch (AGB). The star will be a relatively large and bright red giant. The core of the star will be very dense and hot, and neutrons released by the fusion reactions taking place there can combine with pre-existing heavy elements to create still heavier elements in what is known as the [s-process](https://en.wikipedia.org/wiki/S-process). Those newly created heavy elements can then bubble up to the surface and be blown into space by the strong stellar winds of the star.
Latest Answers