Microsoft was accused of having a monopoly in a market (PC) defined by one single software (Windows) and hardware produced by a lot of PC manufacturers.
Apple could be accused of having a "monopoly" in market defined by their own software and their own hardware.
So in a way, IANAL, but Microsoft had a monopoly with their product in a bigger market than the one created by them, while Apple has a "monopoly" on the market (Apple ecosystem) that exists only because they exist. In this way, Microsoft was creating a monopoly in an otherwise free market, while Apple is a monopoly on their own devices, so if Microsoft would stop selling Windows the PC market will still exist, while if Apple will stop selling iPhones with iOS the App Store market will not exist anymore.
The correct comparison could be with Microsoft which has a monopoly on the Surface market where they produce both hardware and software.