The English idiom “it’s a piece of cake,” is an expression which does not relate in any form to food as one may expect. In fact, it relates to the ease of something.
The expression is used to say that a job or an activity is easy or simple. It is often used upon completion of a task which was much easier than it was expected to be.
The expression can be traced back to the 1930’s and so is a lot more recent that many other English idioms which can be traced back to the time of Shakespeare, or even beyond that. It was first used in 1936 by American poet, Ogden Nash in his poem Primrose Path where he wrote “Her picture’s in the papers now, And life’s a piece of cake.” It is not clear why this expression is used and exactly what is easy about cake but is suggested that it is not related to the baking of a cake which can be a complicated process but actually to the fact that during the early 1900s cakes were given out as prizes in many competitions and thus were something which had to be worked for but which could be won fairly easily. It has the same use as the phrase “as easy as pie,” which is not used in British English but is much more common in American English.
An example of the use of this idiom can be found in the headline of an article on the BBC news website from February 2014 entitled “Angela Merkel: EU reform not a piece of cake.”
Now knowing when to use this expression really should be “a piece of cake!”