E-bikes are interesting. There are many type. They all have their pros & cons.
Mid-drive motor
https://i1.wp.com/electrek.co/wp-content/uploads/sites/3/2018/07/brose-drive-s-mag-header.jpg?w=2500&quality=82&strip=all&ssl=1
Front hub motor
https://www.avdweb.nl/Article_files/Solarbike/Images-mechanical-issues/hub-motor-mounted-in-carbon-front-fork.jpg
Rear hub motor
https://electricbikereport.com/wp-content/uploads/2020/09/Bafang-rear-hub-motor.jpg
The advantage of mid-drive motor is that you can take-advantage of the gear, and use the gear ratio.
Apparently, it's beneficial for motor when ascenting a hill.
P.s. Don't put normal chain from non electric bike on the mid-drive motor, the strong torque can break the chain.
The hub motors are basically more robust, because they don't pass there power through the chain just straight to the wheels.
Front hub are easier for everyday life, as dismantle the front rim for tyre repair would be easier than taken down a rim with motor on the back. You would also experience some unwanted gyroscopic effect. However, as there is less traction on the front, so beware of burnout.
Normally, stronger hub motor are placed on the rear wheel, because it's stonger part of the frame, and more traction on the back. In addition to that, you wouldn't experience any gyroscopic effect in rear hub motor.