Depends on the startup code in the C library used for the MCU.
Main is just a normal function like any other, it is just called by the startup code.
When main exits, it returns to the startup code that called it.
That is it, no surprises there, but what happens then is unknown.
The startup code may continue by doing something, which could be anything, or even nothing.
So you should not assume what happens or does not happen.
Generally, it makes no sense to return from main in an embedded MCU program.
If you do need to stop executing code or restart from main when finished, write your own function to deinitialize the system safely and go into endless loop, maybe blinking a LED for indicating it, or trigger a hardware reset via watchdog or whatever you want.
Options may include:
The startup code does not support returning from main and random code gets executed.
The startup code handles returning from main by entering an endless loop. Interrupts may be left on so background tasks such as interrupts continue working, or they may be disabled. IO ports and peripherals likely stay as they were.
The startup code handles returning from main by jumping back to startup code so basically program execution starts like after hardware reset, but with the exception that peripherals and IO ports etc stay enabled, so this may not work as a reboot unless peripherals are reset.
The point is, if you do return from main, you must know what will happen in your project by figuring out the library startup code, as there is no single answer.