Cordelia was imbued with the 'visions' upon working with Angel in LA.. She pretty much saw people in danger and sent Angel to save them - often helping out... So at the end of S3, she was approached by a demon, Skip, who claimed to be working for the 'Powers That Be.' Skip informed Cordy that she had become a higher being, ready to move to the next dimension and reign as a higher power (one assumes in some sort of paradise)... Anyway, Cordy went, and returned at the beginning of S4 with no memory.. Eventually, her memory came back, but she started doing all these wacked out things (such as sleeping with Connor - who was 18 now BTW, and killing Lilah, and just generally acting like a sooky bitch). Towards the end of the season, she reveals she's pregnant with Connor's child... The gang soon find out the truth, which involves a former 'higher power' having hijacked Cordelia's body whilst she was in the higher dimension.. This 'being' possessed her and pretty much used Cordy all year to do it's evil being... Eventually, it gives birth to itself (through Cordelia's body), leaving Cordelia drained of her life...
Half way thru S5, it seems she's awoken to find Angel and gang running an evil law firm.. She helps out by puttin Angel back on the right track, and essentially showing him that he must continure 'fighting the good fight.' At the end of that episode, Cordelia disappears and Angel receives a phonecall informing him that she has died. It appears Cordelia never actually (by 'actually' i mean physically) woke up, and she only acted in her guiding capacity through astral projection..
So yeah, in answer to your question, her life force was drained and she died in the coma around 6 months later.. Heartbroken? so was I.