How do Python apps are really compiled to all the plataforms?

  compilation, linux, macos, python, windows

I am learning python and would like to know how do apps are really compiled to all OSs from the .py conversion to exe (as well as Mac’s and Linux’s alternatives) through the installer.
I already know about Pyinstaller and how it works but if I have an app that needs other dependencies, how am I going to get it working?

Source: Windows Questions