The earliest beginnings of what became the liver may have been relatives of segmented worms that lived about 600 million years ago. These worms evolved to have sections of their intestines that pinched out and made two little bags. Probably the worms used the bags to keep extra fat in, for when they were hungry another time.
As these worms evolved into arthropods, mollusks, and fish, they kept the little bags. But they found new ways to use them. Mollusk livers started taking in harmful bacteria and the mollusk’s own dead or dying cells, and breaking them down as food for the mollusk. Arthropods developed livers that could break down cellulose into food.
But in fish, which evolved about 420 million years ago in the Silurian period, the liver liver did these things and even more. Some fish used the liver’s fat cells to help them float. Most fish used the fat cells of the liver to store fat-soluble vitamins (Vitamin A and Vitamin D especially). To control when to release the fat or the vitamins, the liver organized a lot of hormones, and these hormones also began to regulate the fish’s blood pressure. Finally, as livers did more and more work cleaning poisons and waste out of the blood, they also began to help the immune system to defeat diseases.
All of these liver functions also work in amphibians, reptiles, birds, and mammals, including in humans. With the liver and kidneys cleaning food before it got to the cells, the cells were able to get more energy out of the food with less work. That left more energy profit for the cells, and fish used that energy to swim faster, move around more, and grow bigger smarter brains than earlier animals.
Learn by doing: get chicken livers from the grocery store and check them out
What early doctors thought the liver was for