That is a three wire motor with a neutral, a forward lead and a reverse lead. The capacitor is connected between the forward and the reverse leads and stays in the circuit. Energizing the forward lead puts the capacitor in series with the reverse winding; and, energizing the reverse lead puts the capacitor in series with the forward winding. It's a nice way to change directions with a spdt switch or relay.

The capacitor can be built-in or remotely mounted. Just from memory, I think the limit switches occupy the same space as the capacitor - in the motor box with the leads. There is only room for one or the other, so if the capacitor is in the box, the limit switches must be separately supplied.