Sometimes, history sucks. Or it's not interesting. Or it's enormously interesting, but Writer Brain is like, "But what if it happened this way instead?" According to Wikipedia, alternate history is basically speculative fiction, because the writer is speculating on a "what if?" idea and changing real, documented history into something else. Also, sometimes, time slip and time travel is involved.