They captured you to lure Sora into their trap.
You're Sora's friend, specifically a close one like Riku and Kairi. Yet you never earned a keyblade, but a darkness related power was given to you.
Ever since the kingdom hearts two arc ended you were...forgotten. When the days, weeks, and months past your own emotions slowly turn off but expressed emotions a little but it was a rare occasion.
Here you are in a dungeon with a chain collar, a hook on your neck with a chain that connects with the hook giving access to get pulled around once the chain was gripped.
But as you stayed there longer the more you got out with Ansem and Xemnas along with the two slowly getting attached to you, Xemnas normally holds onto your chain like a leash and he has a firm grip on it too, as for Ansem he normally keeps an eye out for you just in case you tried to escape.
After awhile they noticed the dark energy you were giving off, it was stronger than Riku's darkness. Then they began using you for your darkness.
Right now you were walking with the two looking for the χ-blade for Master Xehanort's plan to create a new, balanced world free from the chaos.
Xemnas gripped your chain like collar as a leash keeping you close to Ansem and him just in case they need you to power them up with your darkness if they encountered a strong enemy.
Ansem and Xemnas continued to look for the χ-blade as you stayed close with them like Xemnas told you to, you were basically like a bloodhound to them. You were often told to look for the χ-blade or sense if there was danger nearby if the two sensed that's something was off.
Ansem:"Are you sure to this is where Master Xehanort told us to look for the χ-blade?" He asked Xemnas
Xemnas:"Yes he told us to look on Umbravale despite the creatures who absorb my light they shouldn't harm us since we rely on darkness." He responded bluntly