For a sparingly soluble salt XmYn(s)⇌mXn+(aq)+nYm−(aq), the solubility product is Ksp=[Xn+]m[Ym−]n -- the product of the constituent ions' molar concentrations, each raised to its stoichiometric coefficient, once the solid's own (constant) concentration is absorbed out of the equilibrium expression.
Predicting precipitation. Computing the same expression with the actual ion concentrations present (whether or not the solution is at equilibrium) gives the ionic product; comparing it to Ksp predicts the outcome: ionic product >Ksp means the solution is supersaturated and precipitation occurs; ionic product <Ksp means the solution is unsaturated (no precipitate); ionic product =Ksp means the solution is exactly saturated, at equilibrium.
Relating Ksp to molar solubility. If s is the molar solubility of XmYn, then [Xn+]=ms and [Ym−]=ns, so Ksp=(ms)m(ns)n=mmnnsm+n -- e.g. for a 1:1 salt like BaSO4, Ksp=s2; for a 2:1 salt like Ag2CrO4, Ksp=4s3. …