No, garlic is not an onion. While both are members of the same genus, Allium, they are distinct species. Garlic is Allium sativum while onion is Allium cepa.
Although they share similarities in taste and appearance, they have unique characteristics. Garlic has a stronger flavor and aroma than onion, and its cloves grow in a bulb, while onions have layers.
Garlic and onions are both commonly used in cooking and have numerous culinary and medicinal benefits. They are also both considered vegetables, although garlic is often used as a spice.