In case you missed the last couple of episodes of BSG, here's the long view of what's been going on for the last few thousand years...
Cylons were created by humans on Kobol, and were the 13th tribe that left Kobol for whatever reason everyone else left Kobol, apparently. They've never actually explained exactly what happened on Kobol to prompt the 12 Tribes to leave and form the Colonies. (Maybe the toilet in the cellar backed up. Trust me, something like that makes you want to move out quick.)
The Cylons go to Earth, stay there for quite a while, and forget how to resurrect when they learn how to procreate sexually (and who can really blame them?). They develop their own Centurions, who naturally rebel, and the two sides nuke each other. The Five were warned of the coming apocalypse by messengers or "angels" only they could see or hear (which sound remarkably like Head Six and Head Baltar). The Five manage to escape at the last minute (actually a little after that) by having rediscovered resurrection technology.
Earth is now uninhabitable, so they head out to find out what happened to the other 12 Tribes, and warn them of the dangers of creating a slave race. Unfortunately, because they lack FTL drives and have to take the scenic route (which takes about 2000 years, though it seemed shorter to them because they were going really fast, which actually makes sense it you ask Einstein), they arrive just a little too late, as the Colonies have already developed their own Centurions, who naturally rebelled (as Centurions are wont to do).
In an attempt to end the First Cylon War -- which at the time was obviously known as merely The Cylon War, or possibly the Great Cylon War, or maybe even the Cylon War to End All Cylon Wars... wait, where was I? Oh, right -- the Five make a deal with the Centurions: "Stop the fighting, and we'll help you make humanoid Cylons like us, which you've been attempting unsuccessfully with the ship hybrids". So the Centurions end the war, and the Eight humanoid Cylon models are developed.
Except that now the Ones (a.k.a. Cavil, a.k.a. John) think mommy Ellen is playing favorites, and kills his brother Abel... er, I mean Daniel. So now there are only 7 humanoid models, rather than 8, except that there are really 12 (instead of 13) if you count the Five.
Following along so far? Oh, well don't worry. You can go back and re-read it later. Continuing right along...
John/Cavil/One/"Cain" realizes he's in hot water for killing Daniel/Seven/"Abel", and he's still pretty steamed at his mommies and daddies for giving him a pink, fleshy body instead of a Mighty Morphin' Rock'em Sock'em Robot body, so he suffocates the Five, uploads new personalities, and covertly drops them in the Colonies hoping that they'll realize that humans are stoopid and Cylons rulz. w00t!
Then, because he's still a self-hating sadist, he nukes the Colonies in an attempt to destroy that which reminds him of the things he hates most in himself -- those fleshy, weak, emotional humans. Of course, he makes sure that his mommies and daddies aren't killed in the attacks, because he's still not done punishing them for making him. He never asked to be born, after all. (Which, of course, he wasn't, but do you really want to split hairs with a megalomaniac spoiled brat in an old man's body who'd rather nuke you than look at you? Didn't think so.)
And that brings us to the miniseries, which gets good ratings. So season 1 got the greenlight, and earned critical praise. So that led to 3 more seasons and a couple of web series, as well as an upcoming spin-off and made-for-television movie. Which brings us to the present, in which the Centurions have rebelled (as Centurions do) and the Cylons have split into two groups: the uglies and the pretties, with Three/D'anna/Xena-the-Warrior-Princess taking a radioactive sabbatical on Earth. The pretties have made nice with the Colonials, the Five are back together (minus Anders' brain), and everything is slowly falling apart.
Which is all right, though, because it's all happened before, and will happen again. And they have a plan.