The story
Probably bake + apple, influenced by bake in composite words, as suggested by the Oxford English Dictionary. An apparent folk etymology is French baie, qu'appelle which roughly translates as "what's the name of that berry".
Etymology from Wiktionary, CC BY-SA 4.0.