I more or less understand the distinction between what is called a "terminal" and a "terminal emulator". The former referring to an actual hardware peripheral connected to something like a mainframe computer to interface with it textually, and the latter being a piece of software that allows to do the same thing, but just in software and not with actual hardware.
I also gathered that nowadays, terminal emulators in fact emulate the way that these old terminals (like the popular VT100) sent keycodes to the computer, pretending to be them so-to-speak. But in the course of doing some troubleshooting and config on my Linux system, and encountering the odd and somewhat annoying quirks that made me ponder all this, I did some research and found that those devices almost exclusively used a keyboard to interact with the computer (I can't imagine that the mouse was created early enough for these sorts of terminals to support them), and because they belonged to the early era of computing, these keyboards were significantly different to the ones we usually encounter today, and have largely been standardized.
Why am I pointing this out? Well, things like function keys, or caps-lock and num-lock were not usually encountered on a lot of terminals back then (at least I know that function keys are a relatively recent features of keyboards). Because terminal emulators emulate these terminals, they have to use workarounds to be able to support these keys, like sending special escape sequences. In my experience, this makes dealing with the keyboard and the way that the terminal emulator handles it a lot more complicated than it should probably be (at least, that's how it seems to me).
In fact, I started pondering all of this when trying to figure out why trying to define keyboard shortcuts involving function keys above F4 didn't work on some terminal emulators, and why pressing such a function key inside a lot of terminal emulators (at least all the ones I've had any experience with) input a '~' on the command-line. (It's because these keys send escape sequences instead of dedicated keycodes since the terminals that are being emulated did not have function keys, and either they are not properly recognised or something, or the '~' that ends the escape sequence is interpreted as an actual character that the user typed.)
I mean, why do we have to emulate these ancient terminal devices that don't even exist anymore (at least that I know of) in the first place? I get that we need software to allow users to interface with the computer with a keyboard to input commands, and therefore to "emulate a terminal", but what benefit is there for a terminal emulator to still pretend to be one of these devices, whose capabilities were substantially different from that of modern keyboard interfaces, and lacking in some regards when compared to modern keyboards? Unless I am missing something, it seems to me inappropriate to do so given that modern devices have evolved in capabilities and features since these terminals.
It also seems like unnecessary complexity: why not consider the keyboard to just be something as simple as a panel of buttons which all send a specific standard keycode to the computer, instead of dealing with escape sequences to represent keys that didn't exist decades ago? If there was still a major need to support these old terminals I would probably understand, but I can't imagine that they are still so widely used that this is still a concern. Why is the combination of a computer's monitor and keyboard not considered a terminal in its own right, and why don't we define a way for a terminal emulator to send text to a computer that doesn't rely on how old terminals did it, and takes into account how computer interfaces have changed since then?