How is Unity/Mono creating platform independent code?

Hi guys.

I am having a hard time to find out more about the process how the same Unity project is built for different platforms.

My questions are the following:
Are the projects always compiled into a certain CLI (Common Language Runtime) code and then executed “just in time” on iOs,Android,Mac,Win etc.? Or how is this working? And is Mono responsible for creating the correct CLI-Code for each platform?

It would be great if you could help me understanding this topic and link me some articles about how this stuff is working (I could hardly find something about is on Google, maybe I’ve searched the wrong terms).

So, it’s only your script code that is handled by Mono. Each platform has native runtime code. On iOS your script is converted into Arm assembly using AOT compilation. On other platforms is JITted.