Ginny supposedly died in the Chamber of Secrets. She was never found. Voldemort rose to power earlier. But ten years later, Voldemort is killed, Death Eaters are captured, people being held hostage are rescued.
Ginny is one of them. It's a miracle she's alive, a miracle she survived this long.
But it's come at a price. Her wand was irreversibly snapped from the moment she was taken. She was asked to become a Death Eater, but refused, resulting in daily physical punishment.
Back home, Ginny is jumpy, paranoid, and scared she will be taken again. She feels she doesn't know most of her family, her brothers grown up, one dead. Loved by many, she still felt lonely.
That's why fate brought her and Harry Potter together.