Water tends to leach metals near the surface and deposit them deeper through precipitation in two layers. The upper layer is usually made of metal carbonates, oxides, and occasionally pure or native metals, while the second and deeper layer is metal sulfides. The following excerpt is summarized above.
Source: "Secondary Enrichment of Ore Deposits" by Samuel Franklin Emmons, which was published in the American Institue of Mining Engineers, Transaction 30, (1901), p. 177-201.
The paper does not go into detailed chemistry for the most part but mentions that the chemistry varies from one morphology of soil/rock to another. The author postulates a thermodynamic reason along the lines of reduction potential that facilitates this stratification:
The actual changes observed by me in a great body of pyrite ($FeS_2$) carrying galena (PbS or Lead(II)Sulfide) in a limestone ($CaCO_3$)country-rock, which had undergone partial decomposition from the periphery inwards, are as follows: the original fresh pyrite or marcasite crystals are first disintegrated and slightly pitted on the surface, then changed to melanterite or hydrated ferrous sulfate and the galena becomes anglesite. In the outer or more fully oxidized zone, the iron-vitriol has changed in part to yellow, basic sulfate; in part to limonite with a separation of native sulfur.
The theoretical changes that are assumed to take place by the action of waters carrying oxygen or oxidizing agents are: first, an alteration of the iron sulfide ($FeS$) to ferrous sulfate (Iron(II)Sulfate or $FeSO_4$) with the formation of sulfuretted hydrogen (Hydrogen Sulfide? $H_2S$) and sulfur which may have oxidized to sulfuric ($H_2SO_4$)or sulfurous acid ($H_2SO_3$). By further oxidation the ferrous sulfate will become, in part at least, ferric sulfate (Iron(III)Sulfate or $Fe_2(SO_4)_3$), and this in its turn will react upon the remaining ferrous sulfate, or upon the sulfides, and form more ferrous sulfate or sulfates of the other metals which are present. By this cycle of reactions, a supply of both ferric and ferrous sulfates would seem to be provided in the oxidized zone, but the extending downwards of the ferric salts would decrease as the supply of oxygen in the waters became less abundant. It may be assumed that the sulfates of the metals thus formed would be transported for greater or lower distances, generally in proportion to their solubility, the iron sulfates being the most soluble; next, those of copper and zinc; silver sulfate is less soluble and also more readily decomposed, while lead sulfate is extremely insoluble.