Wiring two switches same box
That extra wire was providing hot to the second switch. The preferred way to do this is to connect the hot wire to two short pieces of wire (“pigtails”) with a wirenut. Run these wires to the two switches.

Another way, which I would highly discourage, is to connect the hot to the screw terminal on one switch and the jumper into the backstab of that switch, using the internal metal of the switch to connect them. This is not recommended because many people have had problems with backstab terminal connections going bad.

By the way, I don’t like the unused neutrals being covered just with tape. You should use a wirenut on each. With a single wire, you don’t need to strip the end. Just screw it onto the insulation.