[...] Is it because of electronegativity? If not, what?
Nope. Solubility is complicated, it doesn't relate with other simple attributes, and is hard to predict.
Whether a pair of ions is soluble, or rather how much soluble it is, depends on how easily the ions are solvated and
on how nicely they fit together in a crystal. You can already infer that solubility is a matter of ion pairs
. This explains why mixing two salts can let a new one precipitate.
How easily an ion is solvated depends on the solvent very much, and on how many charges the ion bears, how big it is (including polyatomic ions that may spread the charge), and half a zillion more reasons more or less unknown.
How favourable a crystal is depends on the relative radii of the ions, how they can be ordered, what charge each one carries, and so on and so forth.
Any prediction, or even computation, hence relies on experimental tables essentially. Sorry for the bad news. What theories can bring is limited (but useful): not much more than extrapolate the solubility from one temperature to a not too different one.