I'm not qualified to answer the why, but as for the when --- the best source online for historical statewide election results is http://uselectionatlas.org. Bear in mind that the site uses red for Democrats and blue for Republicans, which is opposite the standard usage in America today; the site predates the widespread standardization of blue for Democrat and red for Republican.
Looking at results for the Presidential election:
One thing you'll quickly discover if you look through the election result maps is that 1980 and 1984 presented an electoral landscape unthinkable in modern US politics: only one state plus DC voted for Mondale in 1984, and only five plus DC voted for Carter in 1980. (The same was true in 1972). All of the northeast except for New York, Massachussets, and Rhode Island voted for Bush in 1988 and for Ford in 1976.
That said, absent some variance in New Hampshire, the northeast's (defined as everything from New York to the north and east) electoral votes have gone to Democrats consistently since 1992.
As for the west coast, California was considered a Republican state up until 1992. Between 1952 and 1988 inclusive, the only time a Democrat won California's electoral votes was 1964, which was an unusual year.