Sugars are one kind of carbon-based molecule, and occur in many different forms in all living things.
Some plants use them for energy storage, and this is why, for example, carrots and onions both taste sweet.
In some plants the sugars are so abundant that they can be extracted and purified. Commercially this is usually done from sugar cane, a very large tropical grass, or sugar beet, a colourless relative of beetroot grown in temperate areas (where subsidised enough).
The refined product from both is almost pure sucrose, which is one of the commonest sugars. Many other sugars are found in milk, nectar, fruit etc.