The cake's are the item themselves. In order to add enchantments to an item with an anvil, you'll need the enchant-able item (swords, axes, etc.) and an enchantment book. You cant put enchantments from other items onto a different item (you cant put the cake and the sword together to combine their enchants)
It can be seen as a collectible item that is cool to have and say you have yes, but you can use it as a weapon by holding it and using it like, I believe it ha knockback V(?) Which is higher than what you can get by normally enchanting so that's fun to play with.