The Chaos army is the only army that is basically the same in both Warhammer Fantasy and Warhammer 40,000; although the Eldar, Orks and the Imperium definitely correspond to the Elves, Orcs and the Empire in the fantasy game, they do not share the same religion or the same units (as the Chaos forces do with their daemons).
The Horus Heresy
In the fictional history of the science fiction universe that the wargame is set in, the Horus Heresy took place after mankind's reconquest of the Galaxy, following the birth of Slaanesh. The Space Marines, the Imperium's elite and the mainstay of the conquering forces, became divided as some turned to Chaos and, led by the Warmaster Horus, turned on the Emperor's forces. This scenario mirrors the classic interpretation of the biblical tale of Satan's fall, with Horus corresponding to Satan, and the other, lesser, "Primarchs" corresponding to the fallen angels.
The armies of Chaos
The Chaos army is roughly divided into four parts -- one for each Chaos god -- although armies are usually composed of a mixture from each cult, producing a more diverse force, as the followers of each god specialise in certain tactics. The Gods of Chaos