To see if a process will take place you need to calculate it's Gibbs free energy $\Delta G$. This is defined as:
$$\Delta G = \Delta H - T\Delta S$$
The quantity $\Delta H$ is the Helmholtz free energy and for liquids and solids is roughly the amount of energy released ($\Delta H$ is negative if energy is released and positive if energy is absorbed). $\Delta S$ is the entropy change for the process. For precise definitions of these quantities have a look on Wikipedia.
The equilibrium constant for the process is the exponent of the Gibbs free energy. If $\Delta G$ is large and negative the process goes to approximately 100% completion while if $\Delta G$ is large and positive the process hardly takes place at all.
Anyhow, for the mixing of two liquids the entropy change is always large and positive so it tends to make $\Delta G$ large and negative and this favours mixing. For two liquids to be immiscible the molecules of the two liquids must repel each other so strongly that the enthalpy of mixing overcomes the entropy.
As an example take water and mineral oil. Water hydrogen bonds very strongly to other water molecules but hardly at all to oil molecules. To mix oil and water you have to put energy in to break all those hydrogen bonds but you get no energy back when the water and oil mix. That makes $\Delta H$ large and positive and this disfavours mixing.
The surface tension arises from the same physics as the immiscibility. Suppose you want to increase the area of the interface. To do this you need to move water molecules from the bulk to the oil/water boundary. But this costs energy because in moving a water molecule to the bounday you break water-water bonds and replace them with water-oil bonds. Since it takes energy to increase the area of the boundary this means there is a force, and this is the surface tension.
The surface tension is a force per unit length (because it's an energy per unit area) and it is independant of the area of the interface. It depends only on the two liquids at the interface.
The walls of the container can have an effect because the liquids will generally interact differently with the container, but normally the surface tension is dominant and it would only be in very thin tubes that you'd see an effect from the walls.
You asked about articles on this subject, and as usual Wikipedia has some excellent articles. have a look at http://en.wikipedia.org/wiki/Entropy_of_mixing and http://en.wikipedia.org/wiki/Surface_tension