Serpentine is an essential mineral in a hydrothermally metamorphogenic rock called serpentinite. Serpentinite is the metamorphic equivalent of peridotite (or dunite) which formed by important process called serpentinization process.
Serpentinization is a process whereby ultra-basic rocks are changed with the addition of water into the crystal structure of the minerals found within it by exothermic metamorphic reaction, the process involves a reduction in heat and pressure (retrograde metamorphism) and that causes the minerals (usually olivine and pyroxene) to destabilize and change into the mineral serpentine.
So where is the source of magnetite through that process?
During serpentinization the peridotite and it's minerals are oxidized by penetrating ocean water and that lead to chemical changes in the primary minerals of the ultra-basic rock as follows:
Olivine is a solid solution between forsterite and fayalite :
Fe2SiO4 + H2O >> Fe3O4 + SiO2 + H2
then,
Mg2SiO4 + SiO2 + H2O >> Mg3Si2O5(OH)4
So the source of magnetite in the serpentinized ultra-basic rocks is the oxidation of fayalite mineral during the serpentiniztion process.
the reaction has been well depicted by Mr. Tarek . There are also primary Cr-Fe-Mg-Al spinel-type minerals in ultrabasic rocks, among others magnetite which can survive hydrothermal alteration as mentioned above and so may be denominated as relics.
I agree with both Dr Tarek and Dr Dill. In serpentinites, magnetite can be related to alteration of olivine and orthopyroxene to serpentine and magnetite. Accessory chromite also alters to ferritchromite and, rarely, perhaps also to magnetite.
But in some unaltered ultramafic rocks magnetite (frequently chromian) can be of igneous origin. It can also result from exsolution of chrome spinel (see Jan MQ et al, 1992, American Mineralogist 77, 1074-1079)
Finally, a considerable range of composition from chromian magnetite to chrome spinel may be prsent in accessory spinel grains that have undergone re-equilibration with adjacent olivine and pyroxene grains.
If I could interfere in this discussion (I was going to post a question on this) this sample is medium soft (but very hard to break) and has an abundance of black magnetite veinlets.
the "green stuff", probably chlorite-, amphibole- and/or serpentine-group minerals can account for the moderated rock strength. The structural pattern of your magnetite veinlets displays no preferred orientation in one direction but a radiating pattern of 1st and 2nd order veinlets which make me think of an initial stage of hydro-fracturing of hydrothermal solutions which step-by-step pass through a fitting breccia and may eventually end up in a rotational one.
In serpentinites, magnetite can be related to alteration of olivine and orthopyroxene to serpentine and magnetite. Accessory chromite also altered to ferric-chromite and, in some times to magnetite.
In some unaltered ultramafic rocks magnetite (frequently chromian) can be (igneous origin) also result from exsolution of chrome spinel.