Yes the memory is automatically detected by the BIOS through the chipset.
BIOS doesnt need any RAM to get working. See how the speaker beeps at you when there is no memory.
Its the BIOS code that resides in the non-volatile ROM region and is run everytime the machine is started. It does many things that dont need any read/write memory before actually setting up memory parameters and then it goes about initialising the processor, display, peripherals etc.
<font color=red>No system is fool-proof. Fools are Ingenious!</font color=red>