It says in SA OC Siman 309 Sif 3 that on Shabbots if one wants to carry a basket that has in it fruits for the purpose of the fruits themselves if there is a rock inside of the basket as well one must shake out the rock from the basket (in order that it shouldn’t be a problem carrying a muktzeh item together with the fruit.) This is however only in a case where the fruits will not be damaged in the process (if they will be one doesn’t have to shake out the rock.)
Why is this not a problem of borer (separating) when one shakes the basket with the intention and purpose of removing only the rock from the basket that is mixed together with the fruits? It could be however that the wording of the poskim (Shulchan Aruch itself as well as the SA HaRav in Siman 309 Sif 5 and M”B in Siman 309 Sif-Katan 11) that one is shaking out the fruit together with the rock. However from M”B Sif-Katan 10 we see that if there is a possibility to take out the rock itself then that should be done. So my question again is removing the rock from the basket by way of shaking it, why is this not considered to be a problem of borer?
It appears that if the fruit are big, and each one is distinct and next to the other, it follows that this is not a “mixture of fruit and a rock,” but rather “fruit and a rock.”
The most basic condition for the prohibition of borer is that there should be a mixture, and so where the neighboring fruit and rock are not “mixed up” with one another, no prohibition will apply in removing the rock. Only if the rock needs to be separated, and not merely removed, does a prohibition apply.
This, for instance, is the reason why the Maharit writes that no prohibition applies to taking a solid out of a liquid, because the two do not for a “mixture” (though the Taz, concerning a fly in a cup of wine, disputes this assertion, and his ruling is mentioned by the Mishnah Berurah).
If the rock is really “mixed up” with the fruit, and an act of separation is required, it will be necessary to shake out the rock with some fruit, so that the prohibition of borer will not be transgressed.
For another approach see here. For a discussion of the matter, see the approbation of R’ Shlomo Amar to a sefer called Shaarei Zion (Boaron).