1000's upon 1000's of miles, occassionally but rarely hall sensor's go so need replacing (that said not yet had one go in any of my hubs over the years), sealed bearing wear and need replacing when they get rough/noisy ( quite a simple task once one has opened the hub).
Hubs compared to mid drive tend to be ultra reliable, likely one reason why 95% of the worlds ebikes are hub motored. Reliability and cheaper cost per unit to run and repair.
Mid drives are the domain for serious off roading but nowadays they have crept in to all bike types, for the most part they aren't necessary for day to day road use or tame offroad byways. Like wise mid drives have 1000's of miles on them but they are a newer invention then hubs so not so many are used, we did have the darby mid drive debacle with kalkhoff bikes they were in effect not suiatble for use.