What is inside the LEGO Powered Up M motor?
Let's take a look. The first step to disassembling the motor is removing the small Philips screw on the bottom:



Now there are a pair of gray tabs in the back white section that we need to release. I found it easiest to cut them down with a knife. Once those are free, the white section slides backwards away from the motor. Try to do this gently, as there are several gears inside that may go flying and be difficult to find.



The motor will be left in the back section.



It isn't fixed in place, so you can simply slide it free of the housing.



We can see that the PCB contains only a few very simple components. I believe that the larger element in the middle is a resettable fuse, and the smaller one on the left is a capacitor across the motor pins to minimize electrical noise. The tiny black element on the right is a 2.2kOhm resistor between pins 5 and 6 that allows the hub to identify this as an M motor.

We also have the gray section of the motor:



Down in the end, there is a planetary gearbox that slides out:



The gearbox simply slides open:



It contains two sets of planetary gears:



Overall, this is very similar to the PF M motor with the addition of a small PCB and a resistor to facilitate the component detection used by Powered Up. It's worth noting that this is the same motor used in WeDo 2.0.