ESP8266 / ESP32 details on the module ITSELF how OTA works copying or changing entrypoint?

Hello Everybody,

just out of curiosity I was asking myself how OTA-updates were realised for the ESP8266 / ESP32 modules.

Most of them have a 4MByte Flashrom which can be divided into different partition schemes which can be chosen in the arduino-IDE.

Now I was aksing myself how is it done in detail?
The OTA-routine receives the new binary-code and stores it into flash-rom. This is clear.
But what is done next?
Is there some kind of bootloader that transfers the new binary from an "OTA"-memory-area to the "code"-memory-area ?

or

does the OTA-code only change an entry-point where the module should start execute code after boot or reset?

with quoogling I did not find information that goes that deep.

best regards Stefan

SDK OTA method is to change entry point, but esp8266 Arduino Update class uses copying.