With a mid motor, an ebike’s weight is well balanced so a large torque can be delivered to the rear wheel when going up hills. Mid motors are best for mountains and regions where you will be climbing steep hills.
Hub motors for are easier to install, but they are better suited for ebikes that are going to be ridden in flat areas.
The transmission efficiency between an ebike mid motor and an ebike hub motor is exactly that same.
I think the big difference is that a mid drive motor powers the bike through the gears on the back wheel, so they can leverage that gearing advantage just as a rider's legs would do. It's a big advantage for hill climbing, but also in other situations. It's also a lot easier on the motor.
That said, mid-drive motors are more complicated to install. You might check out some YouTube videos to get an idea of the process. There are a million of 'em.