People put a glass down, forget which was theirs, and take a new one. That single behaviour is why a party for twenty gets through considerably more than twenty glasses.
The arithmetic
Plan on at least one and a half glasses per person, and two if the evening is long or the crowd is mobile.
For twenty people, that means thirty to forty glasses.
If you are serving more than one kind of drink, the figure rises further, since people switching from wine to a cocktail take a fresh glass.
Running out mid-evening means washing up during the party, which is the thing to avoid.
Reducing the churn
Two things help substantially.
Glass markers, charms or a marker pen let people identify their own. Even a bowl of coloured rubber bands works, and it reduces abandonment noticeably.
A visible place to put empties, whether a tray or a crate near the drinks, stops glasses being distributed across every surface in the house and forgotten.
Both cost almost nothing and are the difference between forty glasses and sixty.
Simplifying the shapes
Do not attempt to serve every drink in its correct vessel at a party.
Two shapes are sufficient: a wine glass and a tumbler. The wine glass handles wine, spritzes and anything long served without much ice; the tumbler handles spirits, mixed drinks and soft drinks.
If you are serving one batched cocktail, a third shape for that is reasonable.
More shapes means more of each is needed, since you cannot substitute across them when they run out.
Hiring and borrowing
Glass hire is inexpensive and frequently free with a bulk purchase from a larger off-licence or supermarket, on the basis that you return them unwashed.
This is the practical solution for anything above about twenty people, and it removes the washing up entirely.
Check the terms: most schemes require the glasses to be returned within a few days and charge for breakages, and most allow them to be returned dirty, which is the main advantage.
Borrowing from neighbours works and produces a mixed collection that is harder to keep track of.
Plastic and reusables
Entirely reasonable for a garden, for a party with children present, or anywhere with a hard floor.
Good reusable polycarbonate wine glasses are far better than tumblers for wine, and they wash and stack.
The compromise is real and the alternative, which is broken glass among bare feet, is worse.
Setting up
Put the glasses out before people arrive, next to the drinks, in enough quantity that nobody has to ask.
Keep a reserve out of sight rather than putting everything out at once, so the table does not look chaotic.
Chill the glasses for anything served without ice, in batches rather than as you go.
Put out water glasses separately and visibly, which encourages people to use them.
The washing up
If you are washing during the party, hot water and minimal detergent, rinsed thoroughly and left to air dry inverted.
Avoid rinse aid in a dishwasher run mid-party, since the residue kills foam on anything served afterwards.
Do not stack wet glasses inside each other, since they stick and break when separated.
Afterwards
Rinse anything with citrus, sugar or dairy in it before leaving it overnight, since residue sets hard.
Check rims for chips before putting glasses away, and discard anything damaged rather than storing it.
Water glasses
Worth a separate mention, since they are the ones most often forgotten.
Put out plain tumblers and jugs of water visibly from the start, in enough quantity that nobody has to look for one.
It costs nothing, it improves the evening, and a party where water is easy to find is a better party than one where it is not.