Many ebikes sport a derailleur hanging out back to giver riders more flexibility than single-speeders. There are exceptions that combine gears with the motor, such as Pinion and Valeo. And now there's another, as Scotland's Intradrive system goes into pilot production.
Because it’s significantly lighter than gearhub, and there’s no better solution available to shifting that’s also light in weight. The sort of gearhub mentioned in the article are mainly for ebike.