Playing Portal the normal way, you never actually reach or eat the cake. However, players have found ways to get to it—most involve cheats, though some skilled runs reach the cake room without them. If you make it there, you also get the Companion Cube. And as GLaDOS famously insists, "the cake is not a lie." Searching "how to get the cake in Portal" will point you to methods if you want to try.