Nothing could be more immediately rewarding than a piece of cake, and to indicate delight, we sometimes say a chore was a “piece of cake.”
The expression first appears in English literature in a 1936 Ogden Nash (1902-1971) poem called “Primrose Path.”
During World War II, the phrase was adopted by British pilots to describe a target that was easy and fun to attack or destroy.
It was from there that the expression graduated into everyday English.