Meaning
A straightforward task that can easily be accomplished.
Origin
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's Primrose 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',