I was wondering why so many different species - including apples, oranges, pickles, and pears - taste so good.
Did they evolve to taste good? Or did our sense of taste evolve to prefer nutritive foods over, say, dirt and rocks?
Fruits are a deceptive strategy by plants to ensure seed dispersal - you eat the apple and either toss away the core or eat it (some folks do) and the seeds pass through your gut. (They have a hard, undigestible shell that protects them.) The bonus there is that the seed is also fertilized by your manure.
But it's a strategy that benefits you, too, because fruits are full of the sugars you need to survive. And your body evolved to "reward" you when you consume the foods it thinks it needs.
Of course, the foods your body thinks it needs are different than the foods a human being living in civilization needs, because your body is operating from the assumption that it may never eat again. Your body is always prepared to enter a period of starvation, so you're always being rewarded for foods that would be a good "last meal." If you were going on a 2-week fast, what would you want your last meal to be? A cheeseburger and a milkshake, or a salad and an iced tea? The former has a lot more of the fats, starches, and sugars that your body can store up to tide you over.
Your body rewards you with pleasure for eating foods that prepare you for starvation. Of course, in a first-world civilization, you almost never starve except on purpose, which explains the problems a lot of people have with weight.