They have a lipid membrane around them to keep out the salty water of the cytoplasm. Simple cells and prokaryotes generally don’t have vacuoles, so vacuoles probably evolved along with the first eukaryotic cells around two billion years ago. Probably they started out when part of the lipid membrane around the cell folded in and then pinched itself off to form a new little membrane inside the cell. Cells that used extra energy to make vacuoles survived better, because they could use the vacuoles to keep the cell healthier.
All plant cells have vacuoles. Plant cells use the vacuoles to keep things in, just the way you might use plastic bags. Sometimes the cell puts garbageor poisons or broken parts of the cell or extra water inside a vacuole. Sometimes the cell keeps food in a vacuole (like hydrocarbon moleculesthat it will break down later for food). Sometimes plant cells use vacuoles like water balloons to stiffen one part of the cell and give it a more useful shape. Some plant cells are almost all taken up by vacuoles.
A video showing a paramecium forming vacuoles and ejecting waste
Most animal cells also have vacuoles, but not all of them. Animal cells use vacuoles to get rid of garbage, and also to get rid of extra water.
The way the DNA in the nucleus tells the cell to put something into a vacuole is by using enzymesas messengers. The cell can use the vacuole to get rid of things it doesn’t want. To do this, the cell puts the garbage inside the vacuole. Then the vacuole moves over to the edge of the cell, and merges with the cell membrane. Once it has a door to the outside, the vacuole opens up and spits out the garbage, and then it seals itself up, and separates from the cell wall again.