The cable has a black wire which connects directly to the circuit and a red wire which connects to the switch. If you are talking about the two wires when looking in a switch junction box or light junction box they will be the switched leg.
Electrical Wire Color Codes Deciphering What Each Color Means
What happens if connect black wire to white wire. If you connect the black feeder wire to the white of the switch and the switch is turned on then the black wire of the switch loop. The standard way to power a split tab outlet is to run a three conductor cable to a wall switch. On a light fixture the black leads to the tip of the bulb. Connect that wire to the black wire of the fixture and the other one to the white of the fixture. The white wire is supposed to be identified with black tape to show. If when you change the lamp and touch the shell while touching something grounded guess where the current goes.
This usually results in a loose connection. Buy one of those cheap voltage sticks and try to find out which is the switched wire it will only show voltage when the switch is on. Connect the pigtail and only the pigtail to the screw terminal in. It will produce a big spark and hopefully blow a fuse or trip a breaker. That way fingers cannot accidentally touch a live circuit. The wiring you placed is caused a switch loop.
White are the ground return which must be unbroken. Anyway by the look of it you are talking about connecting the black which is an active hot 120 v line to white which is neutral common. The ground wire also connects to the switch but the white wire gets spliced to the circuit neutral wire and bypasses the switch. Now if you were to cross the wires in the main lines it would throw a breaker for sure and many times in peoples homes i myself have run into people crossing the wires using the white for hot black for neutral. The motor might run backwards but still as a rule of thumb black on black white on white. In that case if you just touch the bare wires together you get a short circuit.
And loose wires are a very bad thing. Its unsafe black wires carry the live current. If you find more than one wire connected to an outlet or switch correct the problem by joining the wires with a wire connector and include a pigtail a short length of the same type of wire.