In a real solution the total volume of the mixture can be slightly more or slightly less than the total volume of the two substances when separate. Water and ethanol is a classic case, where if you mix X mL of water with Y mL of ethanol, the total volume of the mixture is slightly less than X + Y. As you may be aware, most of an atom or molecule is actually empty space. Molecules exist at an average distance from one another, and that distance is dependent on, among other things, their mutual attraction or repulsion from each other. In an ideal solution, which neglects these forces, this average intermolecular distance won't depend on what the nature of the two substances are, and so will be the same in the mixture as in the separate substances, so the total volume doesn't change. In a real solution, if the average degree of attractiveness between molecules changes between pure substances and the mixture, then the total volume element per molecule can change, which will impact the total volume of the mixture. This effect is certainly more noticeable and easy to understand in gasses, but the principles are virtually the same.