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