The formation of wurtzite GaN nanoclusters in an amorphous silica matrix, via gallium and nitrogen ion implantation and rapid thermal annealing, is identified using Extended X Ray Absorption Fine Structure analysis. The mechanism and the crucial parameters that rule the formation of the nanoclusters are established by the use of molecular dynamics simulations. The dominant structural parameters are found to be the concentration of the silicon and oxygen vacancies that are formed during the implantation and the annealing temperature. It is concluded that annealing at 1400 K and 8% Ga/Si and 12% N/O ratios are needed for the formation of GaN nanoclusters. In addition to that, the GaN nanocluster formation is accomplished only when the vacancy concentrations of silicon and oxygen atoms are equal to 10% and 20%, respectively. Finally, the observation of various snapshots upon an increase of the annealing duration indicates the coalescence of smaller GaN nuclei towards larger ones, designating that the Ostwald ripening is a dominant mechanism.