Apples are the fruit of the apple tree in the Genus Malus. This genus can include the larger sweet apples that are widely cultivated, or other species with smaller more sour fruits referred to as "crabapples". Apple trees are mid-size deciduous trees that actually belong in the rose Family (Rosaceae).
The main function in both reality and the Franchise for the apple is food. It can be eaten raw or cooked and preserved in a variety of ways. Even the wood of the apple tree emits a pleasant smell when burned and is used to impart different flavors to smoked foods. In "How to Start a Dragon Academy", a dragon is seen stealing a bag of apples, indicating that dragons probably like to eat apples, too. Stormfly is seen eating an entire cart of apples in "Living on the Edge".
The apple also figures into several cultures' mythologies, including Norse. The Goddess Idunn is said to give out apples daily to the Gods that keep them youthful.
In "Midnight Scrum" Hiccup got chased by various bounty hunters on an Unnamed Island. Astrid and Toothless heard his call for aid. Toothless dropped the bucket of apples he had collected and rushed to his rider's side against the bounty hunters.
Apples were seen as background objects again in "Saving Shattermaster", with an apple cart chock full of red apples.
In "Dire Straits", when the trading lanes were compromised by Viggo and his Submaripper, Berk was forced to ration food until trade found its way to the island again. Bushels of apples were among the food passed out to hungry villagers. At one point, Hiccup showed compassion toward a hungry little boy by taking an apple out of Snotlout's hands and giving it to the youngster instead.
Apples appeared to be a popular item at the Northern Markets, as many carts of apples were again seen at this location. Stormfly downed a whole cart of the fruit in "Sandbusted".
A cart of apples appeared again being pushed by an Outcast on Outcast Island in "Return of Thor Bonecrusher". Thor Bonecrusher (Fishlegs) waggled his fingers at the man and he nearly swooned, allowing the apple cart to roll away. This implies apples can be grown on Outcast Island.
Apples appeared briefly again, in the background, at the Northern Markets in "Sins of the Past".
Apples also appeared in "Triple Cross" when Ruffnut and Tuffnut filled up Barf and Belch's mouths with apples and then tried to smash them. The dragon instead spit them out everywhere. Later in the same episode, Barf and Belch rained down flaming apples on Johann and the Dragon Hunters.