There have been 5-phase and 7-phase motors, but 3-phase is the most common because it is the simplest and lowest amount of stator-tooth groupings that provide a reasonably smooth output of power.
A stator-tooth is a laminated steel protrusion that has copper wire wrapped around it. buy energizing the wire and then turning the power off, the stator-tooth becomes a magnet, and then it is stops being a magnet. If we imagine that the twelve numbers on the clock are the twelve stator-teeth in a given motor, then: The first phase is when 12, 3, 6, and 9 are all energized at the same time. After the magnetic rotor moves a few degrees, the first phase group is de-energized, and then 1, 4, 7, and 10 are energized. the third phase of course would be 2, 5, 8, and 11.
The most popular style of motor around here is a brushless style with permanent magnets on the rotor. Since there is no connection between the stator and the rotor (which has some benefits), the controller needs to know exactly when to turn each phase on and off to get the motor to spin properly. The hall sensors accomplish that.
There are sensorless controllers as an option, but a motor with halls is much more controllable and smooth when starting from a dead stop. Some controllers start out using the halls, but once they are up to speed they have the option of going into a sensorless mode. Those type of dual-mode controllers are handy if you often get the motor and controller very hot. If the halls fail from heat, you can still get home once you start pedaling to get some forward motion.
A common square-wave controller (sometimes called "trapezoidal") has a sudden ON and OFF to power each phase. I have been told that a sine-wave controller (sometimes called "sinus") uses some electronics voodoo to make the ON and OFF a much smoother curve. This is reported to be more efficient, cooler-running, and less "buzzy" for those builders who want an E-bike that is especially quiet.