  We have performed electrochemical treatment of the van der Waals
antiferromagnetic materials FePS$_3$ and NiPS$_3$ with the ionic liquid
EMIM-BF$_4$, achieving significant molecular intercalation. Mass analysis of
the intercalated compounds, EMIM$_x$-FePS$_3$ and EMIM$_x$-NiPS$_3$, indicated
respective intercalation levels, $x$, of approximately 27\% and 37\%, and X-ray
diffraction measurements demonstrated a massive (over 50\%) enhancement of the
$c$-axis lattice parameters. To investigate the consequences of these changes
for the magnetic properties, we performed magnetic susceptibility and $^{31}$P
nuclear magnetic resonance (NMR) studies of both systems. For
EMIM$_x$-FePS$_3$, intercalation reduces the magnetic ordering temperature from
$T_N = 120$~K to 78~K, and we find a spin gap in the antiferromagnetic phase
that drops from 45~K to 30~K. For EMIM$_x$-NiPS$_3$, the ordering temperature
is almost unaffected (changing from 148~K to 145~K), but a change towards
nearly isotropic spin fluctuations suggests an alteration of the magnetic
Hamiltonian. Such relatively modest changes, given that the huge extension of
the $c$ axes is expected to cause a very strong suppression any interlayer
interactions, point unequivocally to the conclusion that the magnetic
properties of both parent compounds are determined solely by two-dimensional
(2D), intralayer physics. The changes in transition temperatures and
low-temperature spin dynamics in both compounds therefore indicate that
intercalation also results in a significant modulation of the intralayer
magnetic interactions, which we propose is due to charge doping and
localization on the P sites. Our study offers chemical intercalation with ionic
liquids as an effective method to control not only the interlayer but also the
intralayer interactions in quasi-2D magnetic materials.
