There are many similes in English that have the form 'as X as Y' (see this list). These almost always highlight some property - X, and give an example of something that is well-known to display that property - Y. For example, 'as white as snow', 'as dead as a dodo' and, risking a group slander action from our noble friends, 'as drunk as a lord'.
How though, are pies thought to be easy? It seems that, while not being easy to make, pies are generally thought to be easy to eat. At least, that was the view in 19th century America, where this phrase was coined. There are various mid 19th century US citations that, whilst not using 'as easy as pie' verbatim, do point to 'pie' being used to denote pleasantry and ease. For example, the related phrase 'as nice as pie' was used in Which: Right or Left? in 1855:
"For nearly a week afterwards, the domestics observed significantly to each other, that Miss Isabella was as 'nice as pie!'"
In The Adventures Huckleberry Finn, 1884, Mark Twain twice uses 'pie' in that same context:
"You're always as polite as pie to them."
"So he took him to his own house, and dressed him up clean and nice,... and was just old pie to him, so to speak."
Pie was also used at that time for something that was easy to accomplish. For example, The US magazine Sporting Life, May 1886:
"As for stealing second and third, it's like eating pie."
'Pie in the sky', also an American phrase from around the same time, refers to 'pie' as something pleasant that we will receive eventually.
The earliest example of the actual phrase 'as easy as pie' that I can find comes from the Rhode Island newspaper The Newport Mercury, June 1887 - in a comic story about two down and outs in New York:
"You see veuever I goes I takes away mit me a silverspoon or a knife or somethings, an' I gets two or three dollars for them. It's easy as pie. Vy don't you try it?"