The forces of attraction and repulsion between molecules that determine their solubility in different solvents.