The short answer
Flat commute on a budget → rear hub motor. Hills, heavy loads or long range → mid-drive.
Hills and gearing
A mid-drive feeds power through your cassette, so it multiplies torque in low gears and stays efficient on climbs. A hub motor delivers torque directly and bogs down on steep grades.
Maintenance
Mid-drives wear your chain and cassette faster because they put motor power through the drivetrain. Hub motors leave the drivetrain alone but make rear-wheel punctures more annoying to fix.
Battery range
Because mid-drives use your gears efficiently, they often squeeze more distance from the same battery. Model both with the Wh/km range tool on the home page.