Where does the idiom Piece of cake come from?

This phrase is of American origin. At least, the earliest citation of it that I can find is from the American poet and humorist Ogden Nash'sPrimrose Path, 1936:

"Her picture's in the papers now, And life's a piece of cake."

The choice of cake or pie as a symbol of ease and pleasantry is well represented in the language. Other phrases along the same lines include "as easy as pie, or " a cake walk"