Most likely reason is the addition of sugar to the recipe, but I wonder if the chemical reaction of caramelization takes place from the apple’s natural fruit sugar, because of the heat of the oven, saucepan, etc. When you slowly saute sliced onions, for example, after about 20 minutes the onions give off their natural sugar (which you wouldn’t immediately taste if you bit into a raw onion), caramelizes the onions, and they become sweet and coffee-colored. Maybe the same process happens to the apples.