Red, Green, Blue, and Intensity. Each of those are digital, so they can be on or off. That's 16 combinations, so you max out at 16 possible colors.
Red, Green, Blue. For signal-crosstalk reasons each one has their own separate ground, but those 3 pins give you nearly-infinite colors, because they're analog.
If you wanted to add grey, you'd do 0.35/0.35/0.35 volt.
And you can keep subdividing this as far as you want, really.
256 colors? Great, VGA is fine with it.
16 million colors? VGA DON'T CARE.
Even more? YEP
(Resolution/refresh rates would be lacking, but colors? no worries)
So how does the computer know what the monitor supports?
That's plenty to send data over! so what, they just put a little CPU in the monitor and used some serial protocol?
Some pins are tied to ground, some are left to float. The computer can look up that combination in a small table and find out the basic specs of the monitor.
So it had to be extended.
The first version worked by having a ROM of some sort that constantly dumps 128 bytes of data over ID pin 1, synchronized with the refresh (so the computer can tell when it starts and ends)
Fun fact: It includes the year and week your monitor was made!
Now now the ID1 is a bidirectional data pin, the ID3 pin is a clock, and pin 9 provides 5v of power (so the data can be read even when the monitor is off)
So the most commonly used type of DDC on VGA connectors was DDC2B+/DDC2Bi, which is a scaled down version of DDC2Ab.
And to explain DDC2Ab, we have to explain USB.
This one is keyboard, this one is mouse, this one is modem, this one is printer, this one is etc etc.
Your computer didn't have a "scanner" plug!
So the idea of having a connector that could do a lot AND provide some kind of "here's what I am" metadata has always been a dream.
You plug a USB device into a USB port and the computer can figure out what it is and power it and hopefully it's all good. It's way simpler.
But there's at least one more, one that had a lot of momentum at first and never really caught on.
It started as a Philips project, but they created the ACCESS.bug Industry Group (ABIG) in 1993.
Microsoft, NEC, and Digital got involved.
It was designed for all sorts of devices, with many different device classes, much like USB.
and in the DDC2Ab standard.
So the idea was that your monitor would effectively act as an ACCESS.bus hub.
And it's still in use today, though in a very different form.
It was an early version of VGA only used on a few things (like the Acorn Archimedes)
It's basically the same as 15-pin VGA, but with no extra pins for ID.