Here’s a story The Atlantic did last summer about how the flavor designers at Jelly Belly go about their work:
The development process begins with a very specific idea. The taste must be instantly recognizable, says Lisa Brasher, a fifth-generation member of the founding family and executive vice chairman of the board. “When you say ‘pickle,’ do you mean sweet or dill? When you say ‘potato chip,’ do you mean regular or barbecue? Those are very important questions for us.”
The article also has stories of when flavors go wrong, like raw garlic or barf (which apparently “sell like hotcakes”).