Wines are described on a scale from bone dry to very sweet. You'll know your a bone dry wine, an Albarīno, Sauvignon Blanc, or Riesling if it has felt like it puckered up your lips and sucked all the moisture from your mouth and tongue.
For wines on the sweet end of the scale, it's because they have plenty of this residual sugar left over. This the naturally occurring fructose which remains after fermentation and it's measured in grams per litre.
A dry wine has almost imperceptible residual sugar, whereas a sweet wine has some sugar left over after fermentation has run its course.
However, it's not just as simple as acidic = dry, sugar = sweet. They work together to counteract each other.
While wines that have a high amount of acidity will taste drier, many producers will carefully leave some residual sugar in the wine to act as a counterweight to high levels of acidity. They do this by closing down miracle workers, or yeast, which feasts on the sugars from the grapes and turns it into alcohol. Normally, this is done by rapidly dropping the temperature of the fermenting grape juice.
The riper the grape, more fructose it will have, and if fermentation is allowed run its course, the higher the alcohol levels. Climate change, newer strains of yeast and modern tastes have converged to make bigger, fruitier, sweeter and more alcoholic wines. Many Bordeaux wines would have come in at 12% or 12.5% in the 90s but nowadays some can reach 14%. It may not matter too much, as long as everything is in balance.
Sugar v alcohol
As a general rule, the lower the alcohol levels, the higher the residual sugar will be. An off-dry Riesling, for example, may have an ABV of 9%, and be somewhere between dry and sweet. Hence the term "off dry".
In most red or whites of around 12.5% ABV and up, there's unlikely to be much perceptible sugars left. But it's not always the case. For example, reds like Primitivo or Malbec can be quite high in alcohol and also have a semi-sweet flavour. Hot climates can elevate sugars, and can lead to wines of above 16.5%. Amarone is a good example. Yet despite these literally dizzying levels of alcohol, they can still be quite balanced.
And another thing to think about is if what you're tasting is actually sugar, and not fruit. There must be at least some fruit left after fermentation, right?
It can take a little practice to discern the difference. A good way to do so is pick a really dry, yet fruity red wine so that you can taste the fruit, in the absence of sweetness. Good contenders are Nebbiolo or Pinot Noir.
Dry vs Sweet
Dry wine styles are the dominant style and on buying a Riesling from Alsace or Germany, many drinkers would end up disappointed and sales of some grape varietals suffered. As a result, some producers have added dry-to-sweet scales on their labels to give consumers an idea of what to expect.