A “piece of cake” means a straightforward task which is very easy to do. “I’m sure the test tomorrow will be a piece of cake for me. I’ve been studying for weeks!”
The most accepted theory for its origin seems to be this: in the 1870s it was tradition to give cakes as prizes in competitions. In some parts of the USA, slaves would participate in “cake walks” where couples would perform a dance mocking the mannerisms of their masters. The most graceful couple would receive a cake as a prize. We also often speak of something easily accomplished as a “cakewalk.”
Another theory says the expression originated in the Royal Air Force in the late 1930s for an easy mission, and the precise reference is as mysterious as that of the simile, “easy as pie.” Of course, a bite of lemon meringue pie goes down very easy!
The earliest citation of it appears to be 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.”
It was also in the song A Spoonful of Sugar from the musical Mary Poppins, in 1964. When you find the fun in a particular job, so the song says, “then every task you undertake becomes a piece of cake.”
The other side of that scenario is where you have a boss who describes an assignment as “a piece of cake.” You naturally want to believe that and you succeed, but only until you get clobbered by reality.
The term was also used as boxing slang for an easily won fight, and then for any “sure thing.”
I’ll opt for “easy as pie” since I’m not a fan of cake. Not even chocolate cake!