I can not understand how $ APPLICATION is formed from the CMain class?

How are they related to each other?

Please explain with a simple example.

    1 answer 1

    Exactly the same as any other object is created from any other class: using the new keyword.

    In the Bitrix kernel, this occurs in the /bitrix/modules/main/include.php file in the line:

     $GLOBALS["APPLICATION"] = new CMain;