Hub motors sit in the wheel and push or pull the bike independently of your pedaling. They're simpler, less expensive to maintain, and great for flat terrain and casual riding.
Mid-drive motors sit at the crankset and work through the bike's gearing system — so the motor and your legs work together efficiently. They handle hills better, feel more natural, and tend to offer better range. Cost more and require more specialized service, but for serious riders it's usually worth it.