Your confusion comes from the fact that the phrase is used sarcastically. Literally, this phrase means "What caused you to figure it out?"
It could be expanded to "What gave the truth away?"
For example, take this fictitious exchange that you might find in a (bad) detective novel:
William Solve: The killer is YOU, Evalman!
Evalman: Bah! I admit it, I did it. What gave it away?
William Solve: What gave it away was the footprints left on the crime scene!
However, this phrase is most often used sarcastically rather than literally. It's used when the person who asks the question knows what gave it (the truth) away, because it's extremely obvious. It's like saying "Obviously!" or "Of course!"
In this case, Claire's gender is very obvious, so this phrase was used sarcastically.