system
Given the following post, respond as if you're commenting on Reddit:
human
I don't understand how bios works and I don't know how to figure it out.

Why can a bios be edited? Why does it need to be edited? Can I make it to where it can't be edited without physically taking the chip out of the computer? Would this make it impossible to compromise the bios? Is there some kind of bios 101 thing I can read to figure out the answers to these questions?

If you don't know the answer do you at the very least know how I could figure it out?
gpt
In the beginning there were computers, and programmers wrote programs for the computers.  Whatever hardware the computer had, the programmer would just directly access.  If you wanted to move a program from one computer to another, you just had to rewrite the hardware-specific parts of it.  This was okay because there only were a dozen computers and each of them was completely unique.

As computers became more common, the idea took hold that software ought to be able to move between computers more easily, and the concept of an operating system was born.  The idea of an operating system is to separate system software from application software.  Programmers who write application software write it to make system calls instead of directly accessing the hardware, and there's an operating system that translates a standard set of system calls to the specific functions of that computer's hardware.  By the mid-1970s, this was well-understood technology.

Then microcomputers came along.  One of the early operating systems for microcomputers was CP/M - Control Program for Microcomputers.  CP/M had three major components: the BIOS, BDOS and CCP.  The BIOS (basic input/output system) was the low-level interface to the hardware, and was the part that you would rewrite for each new machine type.  The BDOS (basic disk operating system) and CCP (console command processor) ran on top of the BIOS and provided the features that application programs would use, such as named access to files on disk.  The idea was that the computer manufacturer would provide a BIOS for their hardware, Digital Research would provide the BDOS and CCP that ran on top of the BIOS, and software companies would provide user software that ran on top of the BDOS.

When the IBM PC came along, CP/M was still popular, and in fact IBM had contracted with Digital Research to make a new version of CP/M for the 8086 processor.  It was Digital Research's failure to deliver this on time that created the opening for Microsoft to win the IBM contract and write MS-DOS, which followed the CP/M architecture pretty closely.  IBM engineers had already started writing a BIOS, so MS-DOS would have to run on top of it, and so the BIOS / DOS split was carried over into the next generation.

However, the BIOS only included the kinds of things that CP/M, in an era of serial terminals, had been concerned with, like character access to devices, reading and writing sectors on disk, and so on.  As different kinds of application software emerged (particularly games), application developers wanted to make use of more of the hardware (particularly graphics).  So it became common to bypass DOS and the BIOS entirely, and just have the application talk directly to hardware.  IBM, perhaps not realizing the implications, published the source code of the IBM PC BIOS, which allowed competitors like Compaq to make identical "PC clones" that offered the exact same hardware interface and could run the exact same programs.  From this point on, instead of being a custom-written piece of software for each new machine, the BIOS became a standardized piece of software that mostly _didn't_ vary too much between machines.  Somewhere around the 286 or 386 era, it also became common to have the BIOS offer a pre-boot screen that allowed the user to configure aspects of how the computer would run, like which disk device should be booted from.

By the mid 2000s, the core abstractions of the BIOS had been frozen in time since the 1980s, and maintaining backwards compatibility on new hardware was becoming a problem.  To solve this, UEFI (unified extensible firmware interface) was developed, which is a new system that takes the place of the BIOS but is a newer, clean-slate design.  UEFI also has a setup screen the user can go to, which is still sometimes referred to as "BIOS setup" even though it is technically not a BIOS.  Many new computers being sold these days have no option to boot using a BIOS at all, and are UEFI-only.

So, this brings us to your question.  You ask why a BIOS can be edited, but it's not clear what you mean.  You could mean changing the values in the setup screen, or you could mean rewriting the BIOS software itself through a firmware update process.  Why can these be edited?  In the first case, because the computer manufacturer wants to offer the user choices in how their computer will work, and in the second case, so that bugs and security issues can be fixed after the computer leaves the factory.

As to how you can prevent it from being edited, most BIOSes and UEFIs have a password protection option for either booting the computer or going into setup.  UEFI is generally more secure than BIOS, but neither of them is all that strong, and if you're worried about your computer being compromised, you should have other protection measures in place such as full-drive encryption.  Most modern computers have a TPM (trusted platform module) chip that the operating system can use to store tamper-proof encryption keys.  Unlike BIOS or UEFI passwords, TPM encryption keys actually are pretty strong.  This is what you want to look into if you're trying to lock down a modern computer.