There are two types of Borer. The first type is done in the field or factory, and it consists of the preparation of wheat for grinding. Sometimes small stones or clumps of earth are mixed in with the wheat, and they must be removed before the wheat is ground. This process of removal is prohibited on Yom Tov. The second type of Borer is done in the kitchen, and since it is for the sake of that day’s food preparation, it is not considered melekhet avoda and may be done on Yom Tov (though not on Shabbat).
The principle is that on Shabbat, any melakha that separates okhel (food) from psolet (waste) is prohibited, unless it is done as part of the normal eating process (ke-derekh akhila). Three conditions must be met for this separating to be considered derekh akhila: 1) The okhel must be removed from the psolet. 2) The removal must take place just before consumption. 3) It must be done with one’s hand or a fork, but not with an implement designed for separating. This is all explained in Peninei Halakha: Shabbat, chapter 11. In contrast, on Yom Tov it is only the melekhet avoda of the fields or factories that is prohibited, whereas Borer to prepare food for same-day consumption is permitted.
Some examples of Borer that is permitted on Yom Tov but forbidden on Shabbat are: If on Yom Tov one is eating a salad containing little pieces of onion that he does not want, he may remove the onion bits and eat the rest of the salad. On Shabbat this would be prohibited, because one is not allowed then to remove psolet from okhel (ibid. 11:5). Similarly, on Yom Tov, one may remove a lemon seed that fell into a salad or a fly that landed in his drink. Rice may be checked for bugs on Yom Tov.
If one has a mixture of walnuts and almonds, he may remove the almonds for a meal which will take place a few hours later. Similarly nuts may be shelled a few hours in advance of a meal. In contrast, these actions would be prohibited on Shabbat, since the permissibility of removing okhel from psolet is limited to cases in which the food will be eaten immediately (Peninei Halakha: Shabbat 11:6).
One who has wine mixed with lees may use a kitchen strainer to separate them (Shabbat 137b; SA 510:4). On Shabbat this would be prohibited, as it is prohibited to use any implement to separate okhel from psolet (Peninei Halakha: Shabbat 11:7).