Although the VSEPR theory is correct in predicting that CH4 is tetrahedral, NH3 is trigonal pyramidal,

and H2O is bent, the HNH angle in NH3 is only 107.3° and the HOH angle in H2O is only 104.5°.
Explain these deviations from the expected tetrahedral angle of 109.5°.

I think it has something to do with the electron repulsion but I'm not exactly sure. I remember my professor talking about a cube.

CH4 has no unpaired electrons. Both NH3 and H2O do (NH3 has 1 set and H2O has two sets). You're right. Those unpaired electrons repel nearby electrons differently and the HNH and HOH bonds are not 109.5 but smaller.

You are correct that the deviations of the HNH angle in NH3 and the HOH angle in H2O from the expected tetrahedral angle of 109.5° are due to electron repulsion. The VSEPR theory, which stands for Valence Shell Electron Pair Repulsion theory, is based on the idea that electron pairs in the valence shell of an atom repel each other and try to position themselves as far apart as possible. This concept helps explain the shapes of molecules.

In the case of NH3, the central nitrogen atom is surrounded by three hydrogen atoms. The three bonding pairs of electrons and one lone pair of electrons on nitrogen repel each other, leading to a decrease in the HNH bond angle. The lone pair occupies a greater space in comparison to the bonding pairs, creating greater repulsion and pushing the hydrogen atoms closer together. As a result, the HNH bond angle decreases from the expected tetrahedral angle of 109.5° to approximately 107.3°, giving NH3 a trigonal pyramidal shape.

Similarly, in the case of H2O, the central oxygen atom is bonded to two hydrogen atoms and has two lone pairs of electrons. The two bonding pairs and the two lone pairs repel each other, causing a decrease in the HOH bond angle. The lone pairs again occupy more space than the bonding pairs, leading to increased electron repulsion that pushes the hydrogen atoms even closer together. Thus, the HOH bond angle decreases from the expected tetrahedral angle of 109.5° to approximately 104.5°, resulting in a bent shape for H2O.

The mention of a cube by your professor might be referring to the concept of electron pair geometry and molecular geometry. In the VSEPR theory, the electron pair geometry describes the arrangement of all electron pairs (both bonding and lone pairs) around the central atom, while the molecular geometry describes the arrangement of only the bonded atoms. For example, in NH3, the electron pair geometry is tetrahedral because there are four electron pairs, but the molecular geometry is trigonal pyramidal because there are only three atoms bonded to the central nitrogen atom.

In summary, the deviations of the HNH angle in NH3 and the HOH angle in H2O from the expected tetrahedral angle of 109.5° are due to electron repulsion caused by lone pairs of electrons. The repulsion pushes the bonding atoms closer together, resulting in smaller bond angles.