My money's on "Worthless aunt and uncle sold her the minute Lloyd left, knowing it was for experiments". They and the king need to be fed to army ants, feet first. If so, worthless king likely has no idea they're related.
Remember Lloyd started out as a regular knight. During that time she was kidnapped by the king or sold by his relatives (also, Remember that she was gone when he returned to her) to give him a reason to want to go through with the hero implant. The king probably used her & probably others as a Guinea pig before Lloyd received his implant.
Worthless aunt probably had nothing to do with it beyond just being worthless. Lloyd already accused her of getting rid of Cain in the flashback, and she said she needed Cain around to keep getting Lloyd's money.
What's likely is that Cain ran off on her own to die or at least disappear from Lloyd's life under the belief that she was a burden to him and he'd be better off without her. She either got picked up off the street by the mad science division or she went to them willingly if they were taking volunteers from the general populace, with the logic "well at least this way my death might be good for something."
A girl? So Lloyd mistook her for a boy all the time they were together?
Oh well, an imouto yandere isn't bad either way
Wasn't it supposed to be a brother? We know both siblings had experiments done on them, was gender bender magic part of it?
I can't say for certain that the scanlators didn't alter the flashback chapter after first uploading it, but the current version makes no reference to Cain's gender. Not using gendered terms isn't uncommon in Japanese after all.
The king already knows he doesn't want anything,
he knew it from the start even, but still wants him dead anyway because "too much power". So yes he's just an absolute moron, when his plan obviously could've just stopped at sending off to the middle of nowhere.
I also want to point out that the very foundation of the plot in this manga is that the king magically engineered a hero powerful enough to defeat a Demon Lord that wasn't actually interested in going to war with humanity. This king apparently only knows how to do one thing and that's make a stronger weapon to deal with your newest imaginary problem.