The Animus relies on the idea of Lamarckism, which was a theory proposed by Jean-Baptiste Lamarck (1744–1829) which stated that an individual's specific experiences & memories could be passed down to its offspring. If the theory were true (it was the popular theory until Darwin came along), then any one individual would retain at the genetic level the memories of every ancestor in their bloodline. This same deus ex machina is used in the Dune series of books, proposing that the Bene Gesserit along with any "pre-born" can access the memories & personalities of all people in their bloodline (give or take).
In both cases, the individual cannot directly access these "genetic memories" without assistance. In the Dune series, one must consume and survive the Water of Life, which then "unlocks" the memories. In the Assassin's Creed universe, it is accomplished via technology... a la the Animus.
I've only played the first two AC games, so I'm not sure if the premise is always the same. In those two, however, the protagonist was specifically sought out because he was a direct descendant of Altair. Therefore the antagonists believed that Altair's secrets were encoded in his DNA. So, to answer your question, the Animus uses an unknown process (chemical? biological?) to unlock Desmond's genetic memories. The Animus also appears to have the ability to "zero in" on a specific ancestor and force the individual to relive that ancestor's memories as if they were their own.
So basically, via the Animus, Desmond is taking a backseat to Altair's original memories, yet it's apparently a much more immersive experience than simply watching a movie. After unlocking the memories, he appears to be retaining some of the memory & skill even once he removes himself from the Animus device. This was actually the original idea behind Lamarckism - that skills & experiences (not to be confused with learned behavior) gained in a creature's lifetime could be passed down to future generations.