The arrangement of the bonding pairs actually determines the shape of the molecule but this arrangement can only be worked out after the total number of pairs of electrons, both bonding and lone are established
The most common shape of molecules follows the octet rule for example CH4. The four bonding pairs repel each other equally and get the maximum distance apart leading to a perfect tetrahedral shape with bond angles of 109.5°
In ammonia NH3 one of the orbitals is occupied by a lone pair of electrons giving a pyramidal shape with a bond angle of 107°. The electrons are closer because the electron repulsion between the lone pair and the bonding pair of electrons is greater than repulsion between the bonding pairs
In water H2O, there are 2 bonding pairs and 2 lone pairs therefore a tetrahedral shape with a bond angle of 104.5°