$M$CrS${}_{2}$ compounds ($M=\mathrm{Li}$, Na, K, Cu, Ag, and Au) with triangular Cr layers show a large variety of magnetic ground states, ranging from 120${}^{\ensuremath{\circ}}$ antiferromagnetic order of Cr spins in LiCrS${}_{2}$ to double stripes in AgCrS${}_{2}$, helimagnetic order in NaCrS${}_{2}$, and, finally, ferromagnetic Cr layers in KCrS${}_{2}$. On the base of ab initio band structure calculations and an analysis of various contributions to exchange interactions between Cr spins, we explain this tendency as originating from a competition between antiferromagnetic direct nearest-neighbor $d$-$d$ exchange and ferromagnetic superexchange via Sulfur $p$ states, which leads to a change of sign of the nearest-neighbor interaction, depending on the radius of an $M$ ion. It is shown that other important interactions are the third-neighbor interaction in a layer and interlayer exchange. We suggest that strong magnetoelastic coupling is probably responsible for the multiferroic properties of at least one material in this family, namely, AgCrS${}_{2}$.