AT it's most minimum level, all a motherboard needs is enough code to get the hardware running up to the point of loading the operating system, or whatever code it's ultimately going to run. When it powers up, the CPU goes to it's reset location in memory and starts fetching the first instructions, from there and executing them. That code has to be in Flash or some kind of non-volatile memory, so it's always there at power-up. That first code then initializes whatever hardware in the system needs to be setup in order to get enough of it running so that it can load more code, eg loading the OS from a disk drive, to make it fully functional, a process called bootstrapping.