I do this not infrequently. There are some different aspects to why.
If the question is centered around factual information, I may be doing a double-check. Maybe I "know" the answer; but I've been known to have been wrong, at least once or twice in my life. If I ask a question and am expecting a certain factual answer, and i get a different one, that means it is something I need to do research on. I only ask questions like this of people whose answer I respect; idiots need not apply.
If the question is centered around another person's opinion, I may be looking for validation of what I think that other person's opinion is. In such cases, me "knowing" the answer is really just a guess, and I need to double check it. If my guess is incorrect, once again I need to do more research, in this case probably by talking more with the person and trying to figure out the error I made in my guess.
I will often ask questions where I am much less interested in the answer per se, than I am in the other person's response to my asking the question at all. I use this to probe other people, get to know them, understand what makes them tick, and so forth. I'm actually rather well known for doing this, and then telling the other person that I was more interested in their reaction, and what I thought of the reaction. I suppose it is a way of intellectually compensating for that interpersonal intuition that I seem to more or less lack.
And, I have to admit, sometimes I ask questions I already know the answer to just to root out people who don't know what the hell they're talking about. Particularly, I use this tactic against those types of people who have strong opinions on things they do not really understand. If I'm doing this, I'm often looking to put the smack down on someone who I believe is spouting BS; my aim is to make them spout even more BS so I can feed it right back to them.
And, in the vein of asking questions that one already knows the answer to, I often challenge people who I believe are doing this to me. I do this exactly like Magneto.
"Why do you ask questions to which you already know the answers?" - Magneto, X-Men
Good fortune,
- Icarus loves to question things...
_________________
Please forgive me if, in the heat of battle, I sometimes forget which side I'm on.