Actually, elements are not made on earth. All the elements in the earth's crust (except Hydrogen) were formed in stars. Normal burning in stars can fuse (fusion) together atoms to make progressively heavier elements up to the atomic weight of iron. When a star burns all it's fuel it may explode as a supernova. It is these explosions of stars that had enough energy to create all the elements heavier than iron. These were scattered out into the universe and the process repeated billions of times. When the earth was forming (much later) all of the heavier elements naturally made their way through the molten planet to the core. Iron being the most abundant heavy makes the majority of the core. At this point all the gold on earth would be in the very centre of the earth at the core of the core.
At some point later, the earth was sideswiped by a planet almost mars sized and took a chunk off one side. Eventually the material ejected in the planet killing collision solidified into the moon and earth we know today. The core probably got a good stir in the process and gold may or may not have been ejected during the collision.
Later again, the remnants of this explosion and other material from the formation of the solar system (no doubt including gold) crashed back into the earth as meteorites (think the late heavy bombardment period). Many of these may have contained significant masses of gold. These huge (>10km) meteors once again punched holes through the "crme brulee-like" crust of the planet, but nowhere deep enough to deliver the gold contained in the meteor to the molten core of the earth. Magnetic and gravitic anomalies can potentially be accounted for by the increase mass density caused by these impacts and their contents.
The forces involved in the impact, and/or magma pressure from volcanism forced the molten silica glass (quartz) up through cracks in the crust of the earth. The gold introduced by the meteors is carried up with it in suspension. The silicates cool, with the gold coming out of solution and solidifying last and thus clumping together within the quartz in thin layers in the cracks (reef gold) or in pockets (nuggets or crystalline specimens) depending on how quickly it cools I suspect.
Over the years the erosion of the surface has distributed the gold across the alluvial fields and it has been concentrated in leads by the actions of countless river beds, paths, ages and levels.
It's quite amazing to realize that the gold in your pan was once created in the most violent explosions in the history of the universe.
Of course ever atom had to come from somewhere - and as the conservation law states "matter can neither be created nor destroyed, but merely changed it's form", combined with e=mc^2 show that the huge energy available in supernova explosion convert lighter matter into heavier, and release the leftover energy.
The geologists have traditionally argued that gold was brought to the surface by volcanism. This alone fails to take into account the method by which the gold got to earth in the first place. Plus with the heat and toffee-like molten proto earth - the gold will fall to the centre. Volcanos don't draw material up from the core, only from the magma plumes thousands of kilometres from the core. So how does the gold get into the volcanos? They are nowhere near close to being hot enough to fuse gold from lighter elements?
I believe it's got to be redeposited by meteoric impacts. The molten material from these impacts is forced back up by magma pressure from shallow depths compared to the depth to the core.
If you want to see how good atmosphere, life, water and time is at erasing most evidence of cratering from the late heavy bombardment - then take a look at the surface of the moon which has none of those erosive components except time.
Anyway, that my theory and I'm sticking to it.....belligerently and unswervingly, dogmatically and evangelically... until someone shows me better scientific evidence to the contrary. Then I am not too proud to completely adopt a better theory.