Microsoft is hardware company too. Surface, Xbox, computer peripherals, etc.
Now hardware gross revenue is about 3x the services - but the profit margin is much higher on services.
Apple don't break out the numbers so it's difficult to know how much of that service revenue is tied to people owning Apple hardware and how much is independent ( like Apple Music or Apple TV ).