an operating system (OS), such as windows or macOS, handles a lot of low-level stuff. this means that developers don’t have to worry about details like “how to scroll a page” or “how to read text from a file”, because the OS handles it for you. a computer can’t do anything without an OS – it’s needed for even the most basic tasks.
the OS provides you with a huge amount of functions you can call to get stuff done. rather than worrying about the fundamentals of reading a file from a hard drive, the OS will provide you with a function that does the job for you. however, every OS does this differently. this means that you can’t just run windows program on macOS because the functions it needs aren’t there.
wine is a program that translates windows functions into ones that work with macOS or linux. this allows you to actually run windows programs on macOS. when the program asks for a windows function, wine performs the macOS equivalent and pretends it’s running on windows. the macOS version of the sims 3 actually runs in a modified version of wine – it’s the exact same as the windows version, just with a wine “wrapper” around it.
it’s possible to make programs that work on windows, macOS, and linux. for example, games made with the engine “unity” can run on all three of these. however, the actual game file is still different for all three – unity just translates the code into versions that work *individually* with windows, macOS, or linux. this means that you can’t run a windows version of a unity game on macOS.
a java program can run fine on all three of the above operating systems, but you actually have to install java first – and the installer is specific to your OS. it’s not possible to make a program that truly works with all three of these operating systems from a single file with no installers or engines or other behind the scenes work, as the differences are simply too great.
one more interesting note: reactOS is an operating system based on wine technology. its goal is to completely simulate windows without actually using any windows code (as this is illegal) by using the same methods wine does. it’s still in alpha, but it’s really cool!
(i know there are other operating systems, i just didn’t mention them for brevity’s sake. sorry *BSD people.)