Nothing human created is magic
Humans are not capable of magic, if they were, there would be no need for microcontrollers
Don't know for sure, but I guess the following:
We know that microcontrollers consist of many many transistors. I assume that 1 bit (of a byte) is a physical device somehow similar to flip-flop (after applying 5V it stays ON, after applying 5V again it switches OFF). So, when microcontroller is in Programming Mode, data stream sent from PC sets these "flip-flops" in a place called Program Memory in microcontroller. When microcontroller gets powered on, and works in it's normal mode, it starts reading Program Memory at location 0x0 iterates through each bit (of a byte) to the next location 0x1, etc, etc... different combinations of these bits achieve different results, and that's what we need
I might be wrong, but that's how I imagine it works. Anyone else having more knowledge on the subject?