Lets say that the incoming power wire(cable) comes (directly or indirectly) from the breaker box to the light. Great now any time the breaker is on we have light
but not exactly what we want:P so we need to run a wire(cable) to the switch box from the light box if we want it control the light using a switch. Now we will send incoming power down to the light(by code using the white wire marked with some black tape) and send the power thru the switch and back to the light box and back to the light. SO back at a light box wired in such a manor you would have two cables with 2 blacks 2 whites(one marked black) and two grounds. only two of these wires would be connected to the light fixture itself, the incoming white and the returning black. the other two are tied together(yes a white and a black under the same wire nut.
In order to tell if you light is wired using a switch leg scenario, the easy way is to open the switch box and to look and see how many cable enter the box(one if switch leg)