If it was so easy as you said, a lot of macOS apps would've been portable to Windows years ago given the market share.
I work for a cross-platform company, Windows is a much more difficult to develop for compared to macOS. You can write a Cocoa UI but what do you do on Windows when you need to support Windows 7 and above? Win32 controls are grossly outdated but the best accessible/consistent experience across multiple versions, UWP controls is limited to Windows 10 and best under MS Store, WPF has been neglected but so far it is the fastest way to develop a GUI. Microsoft has decided to split UWP out of Microsoft Store to bring it to everyone with UWP XAML Islands etc.
The reason Slack prefers Electron is because you can just write the same HTML/CSS front-end, deploy it, and all Slack apps can simply be refreshed to show the newest UI. You cannot do that with native apps at all. You could get around with a few webviews embedded in the native apps but might as well go full Electron.