Aside from being a rhetorical question, it is also a Conventional Implicature: the primary meaning of the phrase is “this is obvious”, even though this is not the literal meaning of the phrase, and that meaning replies from Gricean maxims of conversation. (“What does ursine defecation have to do with my question as a counterquestion? Ah, it is a vividly expressed exemplar of something obvious…”)
(See Nick Nicholas’ answer to How is it possible that we perceive irony? for more on Conventional and Conversational Implicatures.)
The term got to be a conventional implicature, in turn, by virtue of being vivid language, which sticks as a mental image. In particular, it is an instance (literally) of scatology.