As shown below, rocker switches have 3 electrical connections.
This extra wire provides another connection between the switches so that either switch is capable of sending power to the light.
A double-switch allows you to operate two lights or appliances from the same location.
If you are trying to separate two lights that use the same wiring, as opposed to two already separate sources, you will likely need a trained electrician.
Take the white wire leading to the second box and mark its end black too.
The white wire coming straight from the power source goes uninterrupted into the light fixture while the hot wires are routed through the switches.