The origin of the foliation of ordinary chondrites is addressed through the study of the anisotropy of magnetic susceptibility (AMS) of these meteofites, based on a database of 295 different meteorites, including 35 achondrites (HED and SNC). AMS is a reliable proxy for preferred orientation in ordinary chondrites. Moreover, the intensity of magnetic anisotropy is constant over a given chondrite. The intensity of L chondrite petrofabric, evaluated by means of AMS measurements, and shock stage, determined independently by microscopic observation of shock features in silicates, appear to be positively correlated. This suggests that the oblate petrofabric in L chondrites is shock-induced. The inverse correlation between porosity and AMS intensity suggests that hypervelocity impacts compacted and lithified an originally loose material, causing the deformation of metallic Fe, Ni grains. ILL and H ordinary chondrites cannot be studied as easily as L chondrites: tetrataenite in LL chondrites affects the AMS in an unpredictable way, and shape anisotropy due to the strong susceptibility of H chondrites imposes strong constraints on sample shape. Our limited dataset for carbonaceous chondrites is compatible with a shock-induced foliation model. The very low degrees of AMS in Rumuruti chondrites testify that, surprisingly, the easily deformable Fe-sulfides in these chondrites show almost no deformation, suggesting that sulfidation is a secondary phenomenon that occurred after the major impacts on the Rumuruti parent body. The weak magnetic anisotropy of Martian meteorites implies that no significant macroscopic deformation took place during the severe impacts suffered by these rocks, which is explained by the weak initial porosity and high compressive strength of these igneous products.