If the method of selecting food is an inherited trait, it would have been transferred to the next generation. After many generations, most oystercatchers would tend to choose medium-size cockles. That is precisely what we see today!
This chain of events involves the "selection" of a certain type of individual from many different types. Such a process occurs spontaneously, and is therefore called "natural selection".
The result is that the oystercatcher species has changed with regard to its choice of cockles– from all sizes to a preference for those of medium size.
"Evolution" is the scientific term for this type of natural selection leading to a beneficial adaptation.