Answers:
I tend to believe it means, you are talking without thinking; there is no logic in what you are saying. Your words came out spontaneously, without thinking, not from inside your head. Hence the idiom "through your hat".
Education & Reference Questions and Answers Web