The phrase 'piece of cake' is a metaphorical expression that compares a task or activity to eating a piece of cake. This comparison implies that the task is simple, easy, and requires minimal effort, just like eating a piece of cake. The phrase likely originated from the fact that eating cake is generally considered enjoyable and effortless, so it became a way to describe something that is similarly effortless or straightforward to accomplish.