What rules govern the solubility of ionic substances?

As a teacher, I struggle explaining why NaCl is soluble but AgCl is not. I’ve read it must have something to do with the charge mass ratio of the ions but this makes no sense for AgCl.
Can anyone explain?

The fundamental idea is that the rate of deposition must be higher than the rate of dissolving.
What strikes me as the cause of that is the way it makes a tight “face centre cubic” (FCC) crystal. The crystal is not particularly polar. There’s Ag+ and CL- in nearly equal amounts all over the surface, and so water has no grip on it to destroy it. Its slightly more ‘Ag+’ at the surface, which is repulsive to H+, but its dense and OH- is too big to get close to it. So H2O ,H+ and OH- are not dissolving it.

Meanwhile Cl- can get close and join the crystal , so then Ag+ can join… then CL-, Ag+ , Cl- … a high rate of deposition.

Ok, I’m starting to remember. For ionic compounds in water, it’s the solubility product Ksp.

Isn’t it because the difference in electronegativities of the 2 elements, silver and chlorine, isn’t that great, resulting in the bonding in silver chloride having a high degree of covalent character, and thus not being soluble by the adage, “like dissolves like”?

I’m just happy this thread isn’t about that damn Alanis Morissette song.