If you get into a discussion of ebikes, there's probably a wealth of detail to follow in the mid motors.
We're talking two different technologies here. You've got mid mount motors, which are packed with it. Gears.Electronics. Design innovations.Weight/size reduction are big things. You pay for that, plus the integration and user interface when you look at mid drives, And since many of these are in bukes for specialized tasks, you can talk all day about performance.
Then you got hub motors, which are like garbage disposal's. Just something that spins. Betcha most of the cost is wire/magnets and they must knock them out for about $10/pound like hamburgers. Buy more pounds, you can handle more power. I love hub motors. They're low cost and get the job done, but except for the geared vs direct drive, not a lot of difference.