Question: How does a BIOS get updated? Is it by microprogramming or microcoding? If not, then what happens?

Answer: 
> 
> How BIOS actually gets updated? Is it by by microprogramming/microcoding ? Of no, then what happens?
> 
> 
> 

In the old days, before BIOS was stored on EEPROM/NOR/NAND flash, you had to physically replace the BIOS ROM with a newer chip. Or, if the chip was an EEPROM, you could remove the chip, program it in an EEPROM programmer, and put it back. Almost always, the ROM was socketed for this purpose.

Updateable BIOSes live in surface-mount flash memory or possibly EEPROM on older systems. The connection (which is SPI as @Krunal Desai says) to the rest of the system is via the chipset. All BIOS firmware devices have a connection to the CPU to allow the BIOS to read and execute code from the memory, and also another interface to allow programming.

To update the BIOS, a program has to talk to the programming interface of the flash chip and overwrite pages of it with new data. Something may need to be done to "unlock" it first. These are I/O operation in the same general category as talking to a disk or display controller, not really a "microprogramming" or "microcode" operation.

If you've come across the term "microcode" in relation to BIOSes before, this is a completely different thing. 

Many CPUs have microcode, which are essentially small programs that operate internally within the CPU. The reason for this is that some complex CPU instructions are easier/cheaper to design and handle by microcode rather than directly in hardware. A software developer cannot typically change the microcode of a CPU.

Intel and AMD allow the CPUs microcode to be updated in the event mistakes or errors in the CPU production occur. This happened recently with an Intel chip that introduced "Transactional Memory" or TSX instructions which didn't work properly. Generally, the way it works is that while the BIOS is initializing the system, it will apply the latest microcode update to the CPU. If a different microcode update comes out, the hardware vendor may issue another BIOS update which has the latest microcode. Operating systems can also install the latest microcode themselves.

This is still not "microprogramming" as you are just basically applying a "CPU update" here and not using individual "microinstructions" in your own programs.

The microcode updates are lost when power is lost and need to be applied each time at boot.
Firmware updates are essentially the flashing of a chunk of memory onto a flash memory chip, or EEPROM device on the mother board. The bios code is very critical, as it's the startup code to get the computer up and running for the specific OS (windows, Linux, etc). Also the bios handles many other functions, critical I/O assignments, boot drive selection, etc.

The operating system has an application that handles the actual update of the BIOS code, you are able to download the new code (in hex format) from a web page, or possibly via a USB thumb drive, and the mother board manufacturer will provide a program that talks to it's hardware, and 'pushes' the new BIOS to the mother board. 

Many high end mother board BIOS update routines have a failsafe method of updating, in case the device loses power during the update. The new code is written to a empty area, then a check sum is downloaded. The new code goes through the check sum calculation to verify it's correct. If it is correct, a flag in the bios points to the new area of memory. Then the computer is rebooted, and the new code is used. If anything goes wrong, the flag will still point to the old code, and the user is informed to re-apply the update. 

I wrote and maintained update code for embedded 'black-boxes' used in commercial transportation, medical devices, and multi-media devices; mp3 players, set top boxes, etc.