I am trying to really understand why do we need to make some magic things in those sharp files.
UE4 is split into many modules. Each module has a .build.cs file that controls how it is built, including options for defining module dependencies, additional libraries, include paths, etc.
By default, these modules are compiled into DLLs and loaded by a single executable. You can choose to build a monolithic executable in the BuildConfiguration.cs file.