The wafer is heated in O2
Where Si3N4 remains, O2 cannot penetrate and nothing happens.
Where SiO2 is exposed, O2 diffuses thru that layer to react with Si substrate growing additional SiO2.
The Si3N4 layer is removed by chemically reactive ions.
The resulting thick ring of SiO2 encloses what will become the MOS transistor.