As you begin pedalling the motor starts assisting, you can have cadence sensors (that detect that the pedals are turning) or torque sensors ( where the motor assistance is proportional to how hard you pedal)
There are hub drives (Wayfarer H7 ) , where the motor is actually inside the wheel or...