She was one of Rand al'Thor's guards when he went to the Farm. Liah was one of the Maidens who followed Rand al'Thor to Shadar Logoth and was lost while there.
Despite being trapped, she survived due to her nature as an Aiel, one of the people better at surviving under harsh circumstances than anyone else in the world. Her corruption by Shadar Logoth apparently gave her some protection as well.
When Rand returned to Shadar Logoth while following Sammael, he saw her again and was forced to use balefire on her rather than allowing her to be taken by Mashadar.