She had a feeling, when Harry had altered his chess strategy to expose his king while sacrificing his stronger pieces. It was this, paired with her recollection of his and Neville's experiences that clued her in.