Taste accomplishes its gatekeeper function by the connection between taste quality and substance effect.
Sweet compounds cause an automatic acceptance response and also trigger anticipatory metabolic responses that prepares the gastrointestinal system for processing these substances.
Bitter and sour compounds have the oppisite effect- they trigger automatic rejection responses to help the organism avoid harmful substances such as arsenic or cyanide.
Salty tastes often indicate the presence of sodium. When people are deprived of sodium or lose a great deal of sodium salty in order to replenish the salt their body needs.
Watch this video below to see how the tounge works and where sweet, salty, bitter and sour taste buds are.