Where did this joke come from?

Frylock, your joke has amused me.

It takes a slightly different tack than the typical non-joke, which usually uses an overtold riddle and replaces the punchline with something serious. Yours still sits comfortably in the absurd universe where a bear might go to a school dance, but still manages to subvert the expectation by having the joke teller abandon any responsibility for a specific answer.

Well, it’s a reversal-of-expectation effect, like, “To get to the other side” or “To keep his pants up.”

There are deliberate anti-jokes, but in this case, Louis CK’s daughter was TRYING to make up a real joke. She just isn’t old enough yet to grasp what makes a joke funny.