c ++: How did the x86 BIOS programmers manage to program the full TUIs given very few ROM / EPROM bytes?

I've always wondered how much functionality and relative luxuries (CMOS Configuration Utilities, see: https://geekprank.com/bios/ for an example) included with the most popular x86 BIOS could be included in such a small space. According to Wikipedia, some of the EPROM (small and small size) of 1971-199x; The EPROM reference table does not have many dates. I found it difficult to find a good average size in bytes for an EPROM BIOS CMOS x86 from the late 80s and early 90s, but I guess they were not measured in MB but in KB. This Quora publication seems to confirm this.

The author writes: "The Phoenix BIOS that I wrote in 1984-1985 never allowed the basic ROM, the PC had 8k and it was completely filled in. The XT was placed in a 16k, but probably had about 10k of code. it was about 16k for the BIOS and maybe another 8k for the configuration, and it was usually placed in a 32k ROM. "

32kbs by today's standards is a small amount of storage space. I suppose for a BIOS, most of what it is doing does not need huge layers of abstraction and other storage complications, but I think that programming those TUIs of the CMOS Configuration Utility would be a costly waste of space. Not to mention the BIOS somewhere along the way, they began to be written in C / C ++, which probably wastes some space. Did these early programmers simply use a library similar to ncurses but for BIOS programming? How were these text interfaces designed? Like most UI libs (apart from platform-specific elements such as windows and rendering), even super simple ones (buttons, labels, etc., minimal common widgets) generally require a decent amount of abstraction / complexity that seems Something difficult in a language like ASM even less if ASM is only used to load the minimum before changing to C / C ++ (which seems to be the way it is done today). I'm thinking too much about this? Was it easier than I'm imagining?