Why The Medieval Girl in the Tower Trope Still Exists in YA Lit

What is it about the girl in the tower trope that has kept it in use since the Medieval era? Consider its function and persistence in YA.