The degree of deviation from the thermodynamic equilibrium in the ion velocity distribution functions (VDFs), measured by the Magnetospheric Multiscale (MMS) mission in the Earths turbulent magnetosheath, is quantitatively investigated. Taking advantage of MMS ion data, having a resolution never reached before in space missions, and of the comparison with Vlasov-Maxwell simulations, this analysis aims at relating any deviation from Maxwellian equilibrium to typical plasma parameters. Correlations of the non-Maxwellian features with plasma quantities such as electric fields, ion temperature, current density and ion vorticity are very similar in both magnetosheath data and numerical experiments, and suggest that distortions in the ion VDFs occur close to (but not exactly at) peaks in current density and ion temperature. Similar results have also been found during a magnetopause crossing by MMS. This work could help clarifying the origin of distortion of the ion VDFs in space plasmas.