If your developing the routers, then that means cooking up a bootloader or adapting one to suit your purpose,
Its a bit of code that sits on your device, generally stores the updated flash image somewhere on your device, loads the flash memory programming code to memory and reflashes the program memory with the updated image,
Fancy additions are things like fallback program images. or fallover methods to load the program to the device if an image was corrupted.
And finally to complete the picture is a function to update the bootloader while the device is running.