When a salt is added to a solution containing either the same cation or anion, there will be changes in the solubility because of what is commonly known as common-ion effect. This is so because the solubility of the salt added is affected by the common ions which are already present in the solution. Consider a solution of sodium fluoride (NaF). We are adding magnesium fluoride (MgF2) to this solution.Notice the fact that there is a common ion in sodium fluoride and magnesium fluoride, namely fluoride. You will see that the solubility of magnesium fluoride will be less than expected. To be more precise, the solubility of magnesium fluoride will be less than that of its solubility in pure water. Why is it so? Well the answer is simple; common-ion effect. The phenomenon can be best explained in terms of Le Chatelier's principle. Consider the dissociation of magnesium and sodium fluorides.
Magnesium fluoride is not a very soluble salt. It is a mildly soluble salt, whereas sodium fluoride is a highly soluble salt. Because of the higher solubility of sodium fluoride, there will be a lot of fluoride ions in the solution. This increased fluoride ion concentration in the solution will drive the equilibrium of Equation 1 to the left. Thus the solubility of magnesium fluoride will be highly diminished because of the fluoride ions already present in the solution.
Some general trends regarding solubilities (in water) of common ionic compounds