To ruin a good thing. Philadelphia-area slang. Etymology: allegedly originated at a party where a drunk attendee actually stuck his penis into the birthday cake, preventing everyone else from wanting to eat it.
Mary: Honey, my mother is coming to visit this weekend, so you're going to have to cancel your camping trip.
Bob: Well that really cocks the cake!
"Dude, don't tell your girlfriend you've been cheating on her. You've got a good thing going, and you're just going to cock the cake!"