Your dog's liver performs many important functions. In one sense, it acts like a filter for the blood, to strain out harmful particles and bacteria. A major portion of the blood is carried through the liver. When it becomes swollen due to infection or more serious conditions such as cancer, it can't filter the blood efficiently. That forces some of the fluid portion of the blood to seep out into the abdomen. Chronic (long term) scarring of the liver does the same thing. The fluid in your dog's abdomen (called ascites) could be caused by other problems as well.
These are very grave symptoms, which is why maintaining good liver health in your dog can be a real life saver.
You can look for early symptoms of liver problems by examining your dog's gums on a regular basis. If you notice changes in the colour of the gums (yellowish colouring indicates jaundice) this can be an early warning sign that your dog's liver is getting behind in its work.
The plumbing inside your dog's liver may be swollen internally, and the normal bile pigment (yellow colour) isn't being pumped into the intestines where it belongs, so it's ending up in her blood instead and you can see this manifest in the tissues of your dog's mouth.