For the first situation, the switch is really a "3-way". I know, seems confusing, but that's what they are called. The switched power from the switch goes to your temporary light on the black and white wire. In order to get to the track light, it needs these same two wires. So that is why the second cable is at the temporary light. Most all of your power outlets are wired like this too -- power in, and one or two power outs to other outlets. The last outlet or light on a circuit segment will have just one black and white wire. If you didn't have the second cable at the temporary light, the track light would have to connect at the switch box (which usually wastes wire).
The second situation is also common. This is called a "switch leg" and is what is done when always-on power is brought to the ceiling light box first. Yours is wired backwards from the convention, but it still works. When correctly done, a 2-wire cable will be connected such that the white wire goes to the always-on black wire and the other end goes to the wall switch. The black wire goes from the other switch screw to the light fixture brass screw or black wire. The light fixture white and always-on white are tied together. You have a third cable in there which is providing always-on power to something else -- probably a wall receptacle or a light on a different switch.
The switch leg method isn't used as much now as it was in the 60's. I much prefer having power brought to the switch first, and only take switched power to light fixtures. But both ways are legal. It is also a good idea to tape the white wire of a switch leg black (at both ends). That way, people will know its a "hot" wire and not a grounded white wire.
Lots of wires in a box is common in order to quickly branch out different directions to power receptacles on all walls. There is a limit to how many wires of a given size can be placed in a box. This is based on a certain number of cubic inches that changes per wire size. The cubic inch capacity of plastic boxes is stamped in them nowdays, and metal ones you look up in a table in the NEC.
__________________
Mark
Kent, WA
|