Trial and error.
Most human taste is actually smell. If something smells good, someone tried to eat it.
In western history, people just discovered tomatoes weren’t poison. Italian cuisine as we know it didn’t exist until the 20th century. Possibly because tomatoes have no real odor. They taste horrible on their own.
Latest Answers