How can the gauche-effect be explained?
The gauche effect is commonly explained with LCAO-based bond orbitals. LCAO is short for linear combination of atomic orbitals and implies that we can take two atomic orbitals $\phi_1, \phi_2$ and create two molecular orbitals $\psi_1, \psi_2$ from them by linear combination: $\psi_1 = a_1 \phi_1 + b_1 \phi_2$ and $\psi_2 = a_2 \phi_1 + b_2 \phi_2$.

Considering two neighbouring $\ce{sp^3}$ hybridised carbon atoms, we can create a $\unicode[Times]{x3c3}$-orbital between them by overlapping a hybrid orbital of each; and if $a_1 = a_2$ and $b_1 = - b_2$ (or vice-versa) we can create an antibonding $\unicode[Times]{x3c3}^*$-orbital; both are shown in figure 1 (the bonding in the bottom row, of course). Note that the lobes on each side are the same size.


Figure 1: $\unicode[Times]{x3c3}$ and $\unicode[Times]{x3c3}^*$ orbitals of $\ce{C-C}$, $\ce{C-H}$ and $\ce{C-F}$ bonds (schematically).

If we consider a $\ce{C-H}$ bond rather than a $\ce{C-C}$ bond, we need to take electronegativity into consideration. Compare with the middle column of figure 1: The more electronegative element, carbon, contributes more to the $\unicode[Times]{x3c3}$ orbital, while the less electronegative element hydrogen contributes more to the $\unicode[Times]{x3c3}^*$ orbital. (Note that hydrogen uses a 1s-orbital for binding.)

Similarly for the $\ce{C-F}$ bond, although now fluorine is more electronegative than carbon. And note how fluorine uses a p-orbital for bonding: No energy or anything else would be gained by hybridising fluorine’s orbitals. Neither the size difference between hydrogen’s and carbon’s nor that between fluorine’s and carbon’s orbitals is to any scale and both are grossly exaggerated.

The gauche effect, as a special form of hyperconjugation, relies us on looking at how these molecular orbitals can (or cannot) interact with each other. If we look at the relevant part of the molecule (compare figure 2), we can see that if hydrogen and fluorine are anti to each other, we get a $\unicode[Times]{x3c3}_{\ce{C-H}}$ bond and a $\unicode[Times]{x3c3}^*_{\ce{C-F}}$ bond that have favourable geometries and favourable lobe sizes for overlap.


Figure 2: Potentially overlapping orbitals in the gauche and anti cases of 2-fluoroethanol.

On the other hand, as also depicted in figure 2, the overlap would be bad if oxygen and fluorine be anti due to the small contribution of the less electronegative carbon to the $\unicode[Times]{x3c3}_{\ce{C-O}}$ orbital. (For simplicity, I have rendered oxygen using a plain p-orbital. Oxygen usually has orbitals somewhere between p and $\ce{sp^2}$.)

All this so far tells us why the interaction is geometrically favourable, but we yet did not deduce why it is energetically favourable. And here is where we are, more or less, linear combining the two molecular orbitals we created by linear combination earlier. The combining we are doing is a very general thing, observed not only in the gauche effect here or in hydrogen peroxide, but also is the basis for the anomeric effect in carbohydrates and hyperconjugation. The principle is: If we combine an occupied orbital with an unoccupied one, the occupied orbital gets lowered in energy while the unoccupied gets raised. Because only the occupied orbital contains electrons and their energy is lowered, the entire system gains stability. (You can read the two bolded half-sentences as one.) Compare figure 3.


Figure 3: Stabilisation by combining occupied and unoccupied orbitals

What we have done, is lower the energy level of an already lowered (because bonding is favourable) occupied orbital; the entire system gains. We often state this by saying things such as:


  Electron density is transferred into the antibonding orbital.


But it really boils down to stabilising occupied orbitals. However, that transfer of electron density helps us understand part of the consequences associated with this favourable mixing. If both the bonding and the antibonding orbitals of a certain bond are occupied, you can think of that bond as non-existant; as if both sides had an electron pair. If, on the other hand, neither orbital is occupied, the bond does also not exist, but due to lack of electrons. We can use that analogy to create a mesomeric description of the gauche effect with the two resonance structures depicted in scheme 1.


Scheme 1: A possible depiction of resonance stabilisation corresponding to the gauche effect.

Many chemists out there will vigorously refute this depiction as invalid. Indeed, the resonance structure on the right-hand side of the mesomery arrow shows charge separation and a non-optimal number of bonds. We can therefore assume that it only contributes ever so slightly to the complete picture — which is in line with the electron density only minutely being transferred and also the new bonding orbital (figure 3) being a lot closer in shape and size to the $\unicode[Times]{x3c3}_{\ce{C-H}}$ orbital rather than $\unicode[Times]{x3c3}^*_{\ce{C-F}}$ orbital. But the depiction certainly helps us understand why oxygen cannot do the job: Imagine $\ce{HO+}$ instead of $\ce{H+}$. Looks ugly and unstable from a chemical point of view.