I have been reading that in a center tap transformer, we get 2 voltages which are 180 out of phase. Can someone please explain how that happens.?
A 120/240 center-tapped secondary winding of a transformer is the typical means of supplying household power in the US. The center-tap is connected to earth ground. The secondary sinusoidal voltage is 240 vac between the outer legs, +120 Vac between one leg and ground and -120 Vac between the other leg and ground, making the two 120 Vac circuits $180^\circ$ out of phase. See circuit diagram below. Applying Kirchhoff's voltage law: clockwise +120 +120 -240 = 0.
The 120 Vac circuits generally supply lighting and general branch circuit outlets while the 240 Vac circuits supply major appliance loads (electric ranges, ACs, clothes dryers, etc.). Neutral conductors of the 120 vac branch circuits are connected to ground. The center-tapped ground assures the maximum voltage to ground for the 240 Vac circuits in the household is less than 150 Vac (reducing risk of severe electric shock to ground).