Why do I enjoy the combination of two flavours if they arrive separately, but hate them when they arrive pre-combined?

By way of an example, I was eating a salad which had raw onions in it. I then took a sip of Coke. The combination of the two flavours was amazing, but I know that if someone handed me an onion-infused Coke, I'd find it horrid.

What the hell is the difference?