Insects like all creatures have preferences in what they like to eat. Yellow jackets, for example, are very attracted to sweets, while mosquitos are very attracted to humans. Since some insects eat very specific plants or prey, they must have a way to distinguish one taste from another. While insects don't have tongues the way humans do, when they ingest a solid or liquid they are able to sense it's chemical make up. This ability to sense chemicals is what makes up an insects sense of smell.
How Insects Taste
An insect's ability to taste works in much the same way it is able to smell. Special chemoreceptors in the insect's nervous system trap chemical molecules. The chemical molecules are then moved and placed in contact with a dendrite, a branching projection from a neuron. When the chemical molecule contacts a neuron, it causes a depolarization of the neuron membrane. This creates an electrical impulse that can travel through the nervous system. The insect brain can then direct the muscles to take appropriate action like extending a proboscis and drinking nectar, for example.
How Insects Sense of Taste and Smell Differ
While insects probably don't experience taste and smell the same way humans do, they do react to the chemicals they interact with. Based on the insect behavior, researchers are confident in saying insects do smell and taste. In the same way that the human senses of smell and taste are connected, so are insects. The real difference between an insect's sense of smell and sense of taste lies in the form of the chemical it is collecting. If the chemical molecules occur in gaseous form, traveling through the air to reach the insect, then we say the insect is smelling this chemical. When the chemical is present in a solid or liquid form and comes in direct contact with the insect, the insect is said to be tasting the molecules. An insect's sense of taste is referred to as contact chemoreception or gustatory chemoreception.
Tasting With Their Feet
Taste receptors are thick-walled hairs or pegs with a single pore through which chemical molecules can enter. These chemoreceptors also called uni-porous sensilla, they usually occur on the mouthparts, since that's the part of the body involved with feeding.
Like any rule, there are exceptions, and certain insects have taste buds in odd places. Some female insects have taste receptors on their ovipositors, the organ used for laying eggs. The insects can tell from the taste of a plant or other substance if it is a suitable place to lay its eggs. Butterflies have taste receptors on their feet (or tarsi), so they can sample any substrate they land on just by walking on it. As unpleasant as it is to consider, flies, also taste with their feet, and will reflexively extend their mouthparts if they land on anything edible. Honey bees and some wasps can taste with receptors on the tips of their antennae.