I'm new to it but know it can't handle something special I need. I want to develop functionality for LaTeX. Problem: There's something called just TeX. Then there's LaTeX. And then there's KOMA-Script. So: Which of these three is actually the "underlying engine" that drives all this stuff?
It's TeX. TeX is not just a document preparation language but also Turing-complete, meaning that it is a programming language too. Most functionality you see in LaTeX was implemented in plain TeX.
TeX is the core engine. LaTeX is a set of extensions on top of TeX -- but most people use LaTeX nowadays, since TeX itself lacks a lot of useful features provided by LaTeX.
KOMA-Script is not something I am familiar with.
LaTeX is intended to provide a high-level language that accesses the power of TeX. LaTeX essentially comprises a collection of TeX macros and a program to process LaTeX documents. Because the TeX formatting commands are very low-level, it is usually much simpler for end-users to use LaTeX.
It's much more easier to add functionality to Latex, and if you want to do that, read LATEX2ε for class and package writers (pdf). It has a lot of good information. For knowing more about tex, TeX by topic and/or TeX for the impatient are very good. Of course, there's The TeXbook too, but it's not free (well, the source code for the book is free, but you're not allowed to typeset it).