This recipe uses cornstarch to absorb moisture released by the apples when they are baking. Other methods include cooking down the fruit ahead of time by simmering the fruit before adding it to a baked good. Any time you consider swapping out a fruit in a baked recipe, it is worth comparing the water content of the two fruits. For example, tart apples, as used in this recipe for apple bars, are about 85% water by weight. If I was considering swapping for an equal weight of raspberries (85% water) or pears (84% water), then I'd likely be able to since the same amount of water will be released and I'll need the same amount of cornstarch to thicken the fruit. But if I was considering swapping for an equal weight of strawberries (92% water), then I will probably need slightly more fruit and more cornstarch to replace and absorb the excess moisture released during baking.