Truly a question that has plagued mankind for literally never. It's use in everyday life to get a cheap laugh had come from somewhere, though. And that somewhere was poking fun at a slutty girl at Long Beach State.
Mullally plays Kim Marlow, who was such a skank in college that the phrase actually originated when someone said—without trying to be funny—"That's what Kim said." Why did they say it? Because someone said "It won't fit" and Kim actually happened to have said that the night before. It spiraled out of control from there. Hopefully you can sleep easier at night now.