What is a red wire?

Toggling the switch disconnects one "traveler" terminal and connects the other. Electrically, a typical "3-way" switch is a single pole, double throw (SPDT) switch. By correctly connecting two of these switches together, toggling either switch changes the state of the load from off to on, or vice versa.