Why did my headlights kill my car?

Where is this circuit breaker located?
In the headlight switch.
There is one self-resetting 15 amp breaker.

Then they began to flicker, so I pulled over. As I pulled over, the entire car went dead.

I also had a starter relay failure at about the same time as the total electrical failure. I replaced the starter relay yesterday. Both the battery positive cable and the main electrical feed from the battery go through the starter relay. I wonder if somehow the failure of the starter relay had something to do with this.

The fact that car had lost electrical power when the engine rpm dropped low indicated that neither the alternator or battery could supply enough power to the main splice.
Therefore yes, loose or othewise poor connections in the wires connecting at the starter relay could be a culprit. Additionally, the alternator output could be poor, perhaps at its connections (there are only two). With 14 Volts at the battery while idling might seem to rule out poor alternator output but worth checking a little more precisely. When doing so, be sure to check the ammeter reading (dash gage labled alternator.)