It really depends on what you’re doing, I think.
For instance, if you are developing a game with Sprite Kit, you will find that around 95% of the code is IDENTICAL on Mac and iOS. Sprite Kit itself works the same on both. Sister frameworks like AVFoundation are mostly the same and they have peanut-buttered some #define values to allow “different” classes like UIColor and NSColor to be SKColor, etc. to make it easier to have code that does not needlessly vary. You end up having to clearly think about UI differences between the two but that is true anyway between desktop and mobile.
On the other hand, sure, a utility-style application is not that similar between iOS and macOS once you get past the likes of NSString and NSArray. Yet, utility applications often look and work quite differently between desktop and mobile so this may make sense. And if you rely on the cloud to implement part of the functionality (and share it between the two), you may find that again you are dealing with mainly a lot of UI-centered differences on the two platforms that would have been different anyway.
The iPad is the weird one. Here, Apple probably needs a middle API that really can use exactly the same constructs between mobile and desktop where they actually do end up looking or even working the same.