I believe it works as follows: Each party has a number of electorates (is this the right term?) equal to the total # of electoral votes for the state. The winner take all means that whichever party gets the majority, their chosen electorates are allowed to cast their vote. Now 99% of the time this means that the given party wins that state. However, it's not a guarantee that the electorates will vote with their party. So you could imagine that a state wins, then all the electoral college members vote with the other party and basically reverse the decision. I believe this is possible.