DllMain is executed when a process starts/terminates or a thread starts/terminates. If you don't need code for these events then you don't need a DllMain and the rest of the dll will work just fine. In the code given above DllMain has no effect and can be removed. See https://learn.microsoft.com/en-us/windows/win32/dlls/dllmain
Note that each DLL has its own separate DllMain function, which will be called when certain events happen; fdwReason indicates the event. The function will be called when the DLL is loaded into a process (DLL_PROCESS_ATTACH), when the DLL is about to be unloaded from the process (DLL_PROCESS_DETACH) and also when threads are started (DLL_THREAD_ATTACH) or terminated (DLL_THREAD_DETACH).
The function is supposed to return TRUE, when the event was handled successfully successfully.
The code you have posted is just an "empty" DllMain function that doesn't really do anything – yet. You can use that as a "template" and add whatever initialization or clean-up actions that your DLL may need. Of course, you can just leave it empty 😏