Chemistry is again a study of forces of attraction/repulsion, desires of atom in terms of electron, arrangement of atoms and their half-brothers, spinning of electrons….
An electron having same attributes irrespective of the element it belongs to. Let it be Gold, Copper, Iron, Carbon or Diamond etc. Only thing differs is number of electrons and other subatomic particles. So during formation of earth these particles came together in definite mathematical proportions, which gave rise to vast number of elements; WHEN MATHEMATICS WAS NOT BORN ON THE EARTH!
The Dark Matter may have the answer!