By comparison, boron trifluoride,
To get a better understanding of why this is happening you must take a look at each molecule's electron geometry, which takes into account any lone pairs present on the central atom.
The Lewis structure for
Notice that boron forms three bonds with the three fluorine atoms and has no lone pairs. This means that its electron geometry will be the same as its molecular geometry - trigonal planar.
Now look at the Lewis structure of
This time, a lone pair of electrons is present on the central atom. According to VSEPR Theory, the electron geometry will be tetrahedral
and the molecular geometry, the ones that does not include the lone pair of electrons, will be trigonal pyramidal.