Raoult's law is valid for ideal solutions only. The element of non-ideality enters into the picture when the molecules of the solute and solvent effect each others intermolecular forces. A solution containing components of A and B behaves as an ideal solution when A−B attraction force remains same as A−A and B−B.