It's one of those things that help your cosmetics not to go wrong too soon, aka a preservative. It’s not a strong one and doesn’t really work against bacteria, but more against mold and yeast. To do that it has to break down to its active form, sorbic acid. For that to happen, there has to be water in the product and the right pH value (pH 3-4).
But even if everything is right, it’s not enough on its own. If you see potassium sorbate you should see some other preservative next to it too.
BTW, it’s also a food preservative and even has an E number, E202.