Okay so this is one of those questions that we'll never get a solid answer to but I mean it is fun to speculate, unlike the whole Xemnas-Keyblade debate which there already is a solid answer to but one that no-one acknowledges.
Anyway there's another thread about Xehanort potentially planning to possess Riku again, which I don't necessarily agree with but it does raise some interesting points. The one that came to mind was the potential idea that Xehanort (or the robed figure at this point) chose Riku as his vessel for the events of KH1 because of the memories he potentially retained from Terra.
It's clear at some point Xemnas had some of Terra's memories, so shouldn't Ansem have the same? It's not a stretch to say he can remember Terra passing on the ability to wield to Riku, a boy with darkness of his own.
Anyway there's another thread about Xehanort potentially planning to possess Riku again, which I don't necessarily agree with but it does raise some interesting points. The one that came to mind was the potential idea that Xehanort (or the robed figure at this point) chose Riku as his vessel for the events of KH1 because of the memories he potentially retained from Terra.
It's clear at some point Xemnas had some of Terra's memories, so shouldn't Ansem have the same? It's not a stretch to say he can remember Terra passing on the ability to wield to Riku, a boy with darkness of his own.