When two liquids are mixed together there is a free energy of mixing, this can be given by,
$$\frac{\Delta\,G_{\text{mix}}}{RT}=x_1\ln x_1 + x_2\ln x_2 + \frac{\Delta\,G^{\text{ex}}}{RT}$$
For an ideal mixture the excess free energy, $\Delta\,G^{\text{ex}}$, is zero as the molecules perfectly mix. For a non-ideal system, there is an interaction between the molecules and the excess free energy can be given by a number of models, in this case a two-parameter Margules equation,
$$\frac{\Delta\,G^{\text{ex}}}{RT}=x_1x_2(A_{21}x_1+A_{12}x_2)$$
where the parameters $A_{12}$ and $A_{21}$ are fitted from experimental data.
The mixing of liquids also affects the partial pressure of each liquid and thus the total pressure of the vapour phase. The total pressure exerted by the vapour in equilibrium with the mixture of liquids is given by,
$$P=x_1\gamma_1p_1^o+ x_2\gamma_2p_2^o$$
where,
$$\ln\gamma_1=[A_{12}+2(A_{21}-A_{12})x_1]x_2^2$$
$$\ln\gamma_2=[A_{21}+2(A_{12}-A_{21})x_2]x_1^2$$
If $A_{12}=A_{21}=A$, which implies molecules of the same molecular size but different polarity, the equations reduce to the one-parameter Margules activity model,
$$\ln\gamma_1=Ax_2^2$$
$$\ln\gamma_2=Ax_1^2$$
When $A=0$ the model reduces to the ideal solution, i.e. the activity of a compound is equal to its concentration (mole fraction).
If the $\Delta\,G_{\text{mix}}$ curve exhibits a maximum, then the liquid will phase separate into two liquid mixtures at the compositions of the two minima.