In a lot of languages the word for apple used to refer to all kinds of fruits, particularly new ones from more or less exotic lands. Pineapples also don't look much like apples, do they?
Pomme de terre (IIRC) is a sad version of a underground apple.
Pineapples look like a pinecone but with a sweet fruit inside. Makes sense to me.
Then again horse apples, i.e., horse shit doesn't taste great at all. Then again, again: horse apples, the Osage Orange fruit, are inedible. Osage Orange is neither an apple or orange tree.