Blind Betrayal starts after the BoS has had access to the Network Scanner from Molecular Relay.
Depending on who built the relay, either Tinker Tom, Sturges, or Proctor Ingram handed it to the sole survivor and he ran a network scan. If the BoS gets a copy of it (which Sturges, at least, will gladly make them a copy with no fuss at the Survivor's request), they will start trying to anolyze it (Quinlan being the party responsible). It will take some time (typically the time it takes to complete Liberty Reprimed) and then Quinlan will crack the encryption on the copied data from the Institute mainframe.
On it will be multiple lists and databases. One is a list of all missing synths. In that list is M7-97, an apparent photograph of Danse, and a full copy of his DNA genome. The Brotherhood keeps the same data on file (ostensibly for identifying casualties, I'd assume -- but that's just guessing), and ran a comparison and it was a virtually identical match. With DNA evidence, they were convinced that Danse was a synth.
Danse compounds the problem by going AWOL when Haylen warns him. He even admits that he made it worse when you ask him about it. Instead of there being any chance of him giving his side of the story to Maxson directly, Maxson is convinced that this shows that Danse was an infiltrator (instead of an unknowing dupe), and orders the immediate execution.
If you have X6-88 with you when the truth is revealed, he'll state afterwards that he didn't know that Danse was a synth. Taking him at his word, that means an SRB Courser had no clue and a BoS plant would be one of their most important assets.
One of several reasons I'm equally convinced that Danse is a Railroad refugee.