Ummm... seen Yesterday's Enterprise
Guinan's main purpose as a character is to be someone outside the chain-of-command to whom the main characters can confide or get her advice. She also provides Picard with a friend who's not under his command. By virtue of her position and her age, she's able to see things from the outside and understand the big picture in ways the other characters can't.
And she gives Worf prune juice!