For e-bikes, legal regulations apply. This Wired article outlines the differences between the 3 current classes in the United States:
- Class 1: pedal assistance up to 20 mph
- Class 2: pedal assistance plus a throttle (i.e. can propel without pedaling) up to 20 mph
- Class 3: generally, pedal assistance up to 28 mph, throttle may be optional in some US states
Now, there are various categories of mountain, gravel, and road bikes. For instance, gravel bikes (at the time of writing) are splitting into all-road bikes that are like endurance road bikes with big tires, versus adventure bikes whose use case may overlap some with hardtail MTBs. MTBs have always had downhill and XC bikes, with some categories in between. Road bikes have generally split into performance versus endurance. The performance bike segment had generally been split into aero versus lightweight, but this situation may be evolving. Also, endurance bikes only really became a distinct category in mid to late 2000s.
The above categorizations are all driven by a combination of marketing, consumer demand, and consensus. I'm not aware of law or regulation that applies to this market sector. A lot of the splits are driven by demand by racers. Then, because bike companies effectively use racers to test and market bikes to consumers, those changes trickle down to consumers. However, bottom-up demand can also drive change; I think that endurance road bikes and gravel bikes in general are examples of this happening.