This Thanksgiving, take your cranberry sauce with a dollop of irony. You're eating cranberries mostly because cranberries stopped trying to get mammals to eat them.
Although there are a few plants that migrate, the vast majority of them are stuck in one place. This saves on energy, but has many disadvantages. One of those disadvantages is the lack of any ability to stake out a territory for one's young. Seedlings that drop directly below the plant end up competing with their progenitor for survival. Having a family battle itself is not the way to perpetuate a genetic line, so more successful plants adapted a way to disperse their seeds. They buried them in tasty fruit; fruit that animals would both enjoy and derive nourishment from. When the animals snapped them up, the seeds were either scattered immediately, or carried in the intestinal tract, through the world until they, uh, dropped, far from their parent plant.
To discourage animals from eating the fruit before the seeds matured, much unripe fuit is loaded with tannin, a chemical that makes the fruit taste sharp and dry. As the fruit matures, out comes the sugar, and the fruit begins to smell and taste sweet to hungry mammals.
Cranberries developed quite another strategy. Although the berries are edible, and at one time would have relied on mammals to disperse their seeds, they jettisoned that idea. They stopped adding sugar to their berries, and started pouring on the tannin, discouraging animals from eating them. In order to spread their seeds and relied on the forces of nature. Cranberry bushes thrived by the edges of streams, and their berries developed little air pockets that allowed them to float. Once they were ready to set off into the world, the berries dropped into the water and floated until they could wash up on another shore.
So why do we eat them? Because they loaded up with tannin and float in water instead of being devoured by animals. The tannin made them useful through the ages. Tannins stop bleeding in cuts, cure leather, prevent infection, and dye clothing. And, throughout history, sour food is still better than no food. Now that there are new ways to do most of the above, the main reason cranberries are still eaten is they are easily farmed. They float, so instead of time-consuming days of picking berries from their stems, farmers can flood their fields, temporarily, and skim the cranberries off the surface of the water.
All the work the cranberries did to shrug off the necessity of being eaten results in them being more easily consumed.