All of our senses work because of chemical sensor cells with specific functions geared to a particular part of the body. For instance, sensors in the eyes detect light and color, while those in the inner ear detect sound. Our sense of taste is fairly crude; the tongue has chemical receptors that can only sense sweet, salty, sour and bitter. But the nose can detect thousands of different odors. This is why our sense of taste relies so heavily on what we can smell.
Artificial flavors are chemical mixtures that mimic a natural flavor by combining both tastes and smells. Most natural flavors are quite complex, with many different chemicals interacting to create the senses of taste and smell, but fruit flavors have just a few dominant chemicals, called esters, that create most of the signals we smell and taste and recognize as orange, for example. Adding these esters to a food product will make it taste like that specific flavor, while adding other chemicals in the correct proportions can give even more realistic flavors.