well, it took me some with google, but now I get it.
For all non native speakers: It's a play on words with "That's the way the cookie crumbles", meaning
"something that you say which means that bad things sometimes happen and there is nothing you can do to prevent it, so it is not worth becoming upset about it" (Cambridge Idioms Dictionary)
Karin