The main advantages of mid-drive motors are their lighter weight and better gear usage, making them more suitable for off-road and hilly terrain. With the combination of low speed/high torque and the motor's center position, mid-drive motors can be used effectively for towing trailers or larger riders. Using a mid-drive motor also makes it easier to change tires, as you can still use quick-release wheels. On the other hand, hub motors are quite bullet-proof and have low maintenance costs, making them generally more suitable for commuters and those who want a simple, reliable and almost maintenance-free electric bike. However, many off-road enthusiasts prefer the power and reliability of hub motors, while many commuters prefer the lightweight, stealthy and less noticeable mid-drive motors. This actually depends on the features you need.
The biggest advantage of mid-drive motors over hub motors is their gear ratio. They allow riders to provide power to the rear wheel through the same chain and gear set as the pedals, which means low gears can be selected to provide power on steep hills or accelerate from a stop with huge torque. Low-gear mid-drive motors can climb steeper hills than a similarly-powered hub motor, and for longer periods of time, the latter may overheat during long, steep climbs.
Mid-drive motors are also typically smaller and lighter than similarly-powered hub motors. The newly released mid drive motor series for racing weighs only 5 lbs (2.3 kg). Smaller, lighter mid-drive motors are typically more stealthy, as they can be directly integrated into the bike's frame. Many people don't even realize there's an electric bike when they see a mid-drive motor.
Replacing the tires of an electric bike with mid-drive motors is much easier, as you don't have to deal with the heavy wheel hub motors. You just need to replace them like you would with a regular pedal bike. Additionally, since you can use regular bike wheels, you can freely use any wheels, tires and flywheels you want.
Finally, mid-drive motors allow for the use of a true torque sensor in the pedal-assist system, which adjusts the motor power based on the force you apply to the pedals measured at the crank. Wheel hub motors typically rely on a cadence sensor for pedal assist, which only adjusts the motor speed based on pedal speed and may cause the motor timing to be unstable or awkward, especially when climbing or maneuvering around obstacles on the bike.