The tongue is the organ of taste in mammals. When a substance gets into the mouth of a mammal, the salivary gland secretes saliva which moistens the food. This increases the surface area of the substance and ensures easy detection of taste. The cells of the tongue responsible for detection of taste are called taste buds.
Different parts of tongue detects different chemical substances. The tip of the tongue contains taste buds that are responsible for detecting sweet substances. The side towards the front contains salt-detecting  buds and which helps to detect salt in food, while the side towards the back, contains sour taste buds used for detecting sour substances. The back which contains bitter taste buds helps in detecting bitter substances.