Short answer...
BIOS is currently an incorrectly misused term. But when you buy a BIOS from AMI, etc., it boots the chip/system as well as providing legacy basic input/output services via software interrupts.
It is written in a high level language so compiled with stacks and RAM needs so there is some SRAM on the chip it uses to get through the boot process. The code itself lives on a flash on the motherboard. Whether it runs directly from the flash like an MCU or is copied to RAM in some way, I don't know.
DRAM modules contain an EEPROM with SPD data (JEDEC standard), that, among other things, tells the bootloader how much dram there is. That is how the bootloader (BIOS) knows how much RAM is there.
In the case of UEFI, or even BIOS for that matter, BIOS vendors, motherboard vendors, operating system vendors, it is in their best interest to push this very unique PC compatibility standard, be it formally or not. UEFI changed things was driven by Intel initially (EFI), but then into a community. Legacy BIOS mode, I would argue, was probably maintained/enforced by Microsoft and Intel on the BIOS/motherboard folks as they wouldn't be in business if they angered those companies.
TL;DR
Understand that there is an intimate relationship between a specific motherboard and the BIOS on it. When you develop a motherboard, there is a lot of commonality in the pc world sure or in the specific Intel chip/socket world or AMD. But still there is a reason why you are making yet another motherboard. Due to history and various reasons, there is a very very small number of BIOS vendors, if you want to have a good chance at success you simply call one and pay what you need to pay, and get a BIOS. This is not like I bought a computer and without discussing it with anyone else I chose to run Windows, BSD, Linux or something else on it. The processor/chip vendor (Intel or AMD), the BIOS vendor (AMI, Insyde Software, Phoenix Technologies, etc), and you, the motherboard creator, have a three-way relationship if there is a hope of success. There is also a reason why there are relatively few motherboard vendors out there.
What the BIOS does and offers also has a history I won't necessarily go into here.
The processor needs to boot off of a non-volatile media in some form. A flash on the motherboard. So, from a boot perspective think microcontroller where you have code running from a flash. Now that doesn't mean that you have to run wholly from it it may be that you run a small loop that copies it to some fixed SRAM somewhere, or it may be that the hardware reads the flash for you into ram. I am not up to date on how the current Intel and AMD processors work with respect to booting from reset and on chip resources (just paid the BIOS folks and followed the reference design and programmed the flash with the bytes from the BIOS folks and it booted).
DRAM/DDR is a mess, it can take weeks to months to get it running right, it is not necessarily a trivial task (new IP, etc, existing/known ip and a matching board layout design, maybe hours or days). Either way due to the cost and history we are used to our dram being plug in modules, as a result of that how do you know what is out there and perhaps that is your question. If you search for serial presence detect at Wikipedia you will see the JEDEC spec for information provided by the module to the controller/host. There is an EEPROM or equivalent on the module on a known bus (I²C I believe), that contains the SPD information for that module. From that information you discover not only the amount of memory but several timing settings required to get the dram to work for the specific dram chips on that module (and DRAM tech/generation DDR2, DDR3, DDR3L, etc). Rank/bank, widths, etc. It will include one to several possible speeds as well.
The software on the host side, which we lump into the term BIOS (think bootloader), which has intimate knowledge about the motherboard and the processor or valid processors that will work. As well as knowing what the dram controller is capable of, and matching up with one of the possible combinations advertised by the dram module. So for example the module may support 2133, but the host controller may only support up to 1666 if that speed is supported by the module that is the or a speed it will try.
Naturally the BIOS is not some hand coded assembly that requires no RAM and relies only in general purpose registers. So yes, there has to be some SRAM somewhere, I don't know these Intel chips at this level (again very very very few people use these chips in this way), if you look at Linux capable ARM chips there is some SRAM on those chips. A (non-x86) chip I am familiar with, the DRAM cache can be used as direct access for this kind of work along with some other on chip SRAM, so the chip can be booted using these on chip SRAMs (used for stack and data, run code from flash or also to run code from depending), then when dram is up the cache is re-configured as a cache and the DRAM is now available. The bootloader then goes on to finish its job and then looks for media containing the operating system and loading and starting it.
It is in my opinion getting easier to, for example, make an AMD motherboard, been a while since seeing an Intel come up personally. They are both pulling more of the formerly multi-chip solutions into one chip/multi chip module. There is a lot of black magic if you will based on history of being in the motherboard business. One would expect that Intel or AMD have the detailed information needed to understand this, but is this publicly available (how many folks are making motherboards, how many folks are writing BIOSes, how may folks willing to pay for support contracts, how many folks are willing to buy development boards/reference designs). Either way, though if there is publicly available information, you need to start with Intel or AMD. Expect some percentage of the answer to be generic across a few generations of these products as well as some of the answer may be specific to one particular product.
So:
There is a flash that holds the bootloader and the board design is such that it matches the processors boot requirements to put that flashs contents out in front of the processor booting. There does need to be some on chip sram to assist in the boot process, yes. How you determine how much dram is based on knowledge of the dram chip and controller spec/parameters. For plug in modules which we are used to, there is a small eeprom or similar that contains the SPD data for the module/chips on the module so that the bootloader knows not only how much total ram there is but many timing parameters required to talk to that dram properly.
There are supposedly some open source BIOSes out there, if I remember right they are a bit dated, and probably limited to what motherboards if any they support, they might just be an actual BIOS implementing BIOS calls and not a full blown x86 bootloader intended on bringing up a motherboard. Normally the BIOS/bootloader is something you just purchase from AMI or Insyde, etc., the processor you have chosen to design around may determine which bios vendor or vendors to choose from. Source code to an AMI BIOS or other has a hefty price as well as a long legal agreement. Probably including some form of "if you lose/leak the code you agree to let us drain your bank account to clean up the leak". I suspect the flash is readable and you could attempt to reverse engineer it, but I also suspect that it is compiled code not hand written asm so it won't be that easy to read. Best off just understanding the process and leaving it at that.
If you really want to experience this move on from x86 and go with ARM based as there are open source bootloaders, documentation to some extent on the logic (the dram controllers, and pcie and such are purchased IP from some third party with an NDA so only some percentage of the detail of that peripheral is in a TI or Broadcom or Allwinner, etc chip). But at least open source init code and drivers for Linux, which is better than disassembling something. You can pick up a BeagleBone Black or a Raspberry Pi (bad example; DRAM is done in the GPU, although that is now open I think to some non-zero extent) or countless Allwinner based boards.
At a high level the experience and process is the same, boot, init stuff, load the OS, launch the OS. DRAM init, PCIe init, USB init, ethernet, happen at the right time in order to boot and launch. The technologies are the same (DDR2, DDR3, DDR4, PCIe Gen 1,2,3, USB 1, 2, 3, etc.), in some cases the purchased IP is the same or similar, etc.
Yes, BIOS means basic I/O services, and historically was a bunch of software interrupt based handlers to do things like talk to video or talk to a hard disk, etc in a generic way so that when you bought a video card it physically had a rom on it that contained the video BIOS for that video card, there was a process by which that BIOS was linked into the system so that when you called one of those int syscalls it would use code on that flash. Same for the hard disk controller, etc. The idea being read one sector didn't require you to have to know the intimate details of a floppy drive controller or hard disk controller you had these high level system calls.
The terms BIOS and CMOS have sort of been overloaded to include not just what was the BIOS (which probably also included the bootloader, the original source code is/was available in the original Intel PC manuals which I still have one laying around somewhere from my original PC (which I don't have any more sadly)). Today the operating system relies on BIOS or EFI to get this generic I don't need to know approach but then once the OS is running it then loads controller specific drivers and no longer needs to thunk down into the BIOS system calls. This is a very much PC thing based on PC history, non-PCs take more of a traditional approach.
So yes the BIOS is/was some code that handled software interrupts (system calls), but we also incorrectly or correctly apply the term to include the bootloader. When you buy a "BIOS" from AMI, etc., it does boot the chip.