Sometimes home sellers will leave partial cans of paint behind when they move out so that the buyers have paint for touch-ups. Old paint isn’t really that great and if it isn’t used it has to be disposed of.
It is super easy to match up paint colors when small amounts are needed for touch up. Usually, you can use a scrapper and find some loose paint or peel some off with a razor blade. It isn’t hard to find tutorials on the internet. Take it to a home improvement store or where ever you buy paint and they will make the color for you.
When I paint I write on top of the can the date I bought the paint and what I used it for. I don’t keep leftover paint more than five years and that is probably too long. Check with your county for information on how to dispose of old paint.
If you are buying a home and the seller offers you partial cans of paint it might just be easier to say no thanks. If the sellers offer to leave a ladder behind say “yes please”.