The moths were not silver initially because the trees were initially the white birch trees that we are familiar with. It's not that easy to see a silvery white moth on this, so they were initially camoflauged. Then industrial soot started depositing on these same birch trees, and silvery moths weren't all that camo anymore against a black background. They stood out, and were quickly eaten up. If they happened to have a darker kid, though, it would survive to pass its dark genes on because the hawks wouldn't see it as fast. This would continue and over many generations the standard colour of the moths was black because that was (almost) the only gene left in the gene pool.
Your example about the plant and the berry is one of co-evolution; I thought I'd give you the official name because many books and essays have been written on it and it might interest you to read some.
Generally co-evolution occurs between species when there is either mutual benefit or an "arms war" in which one or both change to be able to better help or hurt each other. One thing I always try to remember is that there is no intention, force, desire, will, or anything else 'directing' evolution. It is all just a direct response to the ecosystem that makes certain members of a species more likely to be killed. By being killed before having kids, they don't get to pass on their genes.
Thus, the right colour wasn't "chosen" for the butterfly eggs, and in the case of the industrial moths there was no choice of when to change colour. All just response to environment.
In the case of the plant and butterfly, I'm going to assume that the plant had berries in the first place, because many do (it's how they spread their seed), but let's say they were large and red, not small and yellow like the butterfly eggs. Genes for colour are often determined by varying degrees of expression of a few colours that blend to make the colour we know.
Now, the butterfly starts landing on the plant and laying eggs - but they are yellow and small, not red and big. Regardless, other animals enjoy eating eggs because they provide nutrition. So animals start eating these yellow eggs on the plant, which is killing off the butterfly's eggs.
By chance, though, once plant may mutate to make a batch of berries that is very unusually small for that species, and perhaps a bit of a lighter red. The butterfly continues laying its eggs on, but when predators come to eat their eggs, some colourblind species might be fooled into thinking the berries are eggs, and eat them instead! This is awesome for both the plant and the buttefly, because:
1) Plants want their berries to be eaten. The whole reason berries taste good is so creatures eat them and disperse the seeds inside.
2) The butterfly doesn't want its eggs to be eaten. It means having fewer children.
So by having other animals mistaken the eggs for the berries and the berries for the eggs, that batch of berries and that batch of eggs is able to better pass its genes on, while the larger redder berries don't get eaten as much (thus don't pass on their genes) because other animals don't think they are butterfly eggs which are more appetizing.
So the genes that were involved in chance mutating the berries to be smaller get passed on and survive very well, and this happens again and again - when there is some mutation in either the eggs or the berries that makes them look more similar to each other, it will be preserved not because of any sort of design, but those genes survive the best, and eventually they will converge in shape and pigment to look exactly the same.
I hope this helps; these kinds of things are better explained in conversation but I hope you get the idea. Just remember that it's not force, will, or design, merely preservation of random genetic mutations because those members of the species survived a bit longer to pass genes on.