Both apples and grapes grow from trees and thus require the Beracha of "Borei Peri Ha'etz" before their consumption. The question arises, if one wishes to eat both apples and grapes, over which fruit should he recite the Beracha?
The answer is that since grapes, unlike apples, are among the Shiv'a Minim – the seven special species of fruits with which the Torah praises the Land of Israel – they have a unique status and therefore take precedence. Thus, in such a case one recites "Borei Peri Ha'etz" over the grapes and may then partake of both the grapes and the apples.
Another question addressed in Halacha concerns the Beracha Acharona – the Beracha recited after eating. Grapes, as mentioned, are among the seven special species of the Land of Israel, and thus require after their consumption the Beracha of "Al Ha'etz Ve'al Peri Ha'etz." Apples, by contrast, are not among these seven fruits, and therefore after eating apples one recites "Borei Nefashot." The question thus arises, which Beracha or Berachot does one recite after eating both apples and grapes?
The Shulchan Aruch writes that since the text of "Al Ha'etz" makes reference as well to all fruits ("Ve'al Ha'peirot"), it covers even fruits that are not among the seven special species. Even though fruits other than these species do not independently require the recitation of this Beracha, if one must in any event recite this Beracha because he partook of one of the seven fruits, it covers all other fruits, as well. Therefore, one who ate grapes and apples recites only "Al Ha'etz," and need not recite "Borei Nefashot."
Summary: One who eats apples and grapes recites the Beracha of "Borei Peri Ha'etz" over the grapes, and may then partake of both the grapes and the apples. When he finishes eating, he recites only the Beracha of "Al Ha'etz."