Benedict discovers Sophie is the Lady in Silver much later in their story, and in the original Bridgerton book it happens during a playful game in the nursery.

Direct answer

In Julia Quinn’s novel An Offer From a Gentleman , Benedict realizes Sophie is the Lady in Silver when he walks into the Bridgerton nursery and sees her playing blind man’s bluff with the children while blindfolded; the way she moves and sounds makes him recognize her as the masked woman he danced with at the masquerade, and he confronts her right after that scene.

On the Netflix series, as of the end of Bridgerton Season 4 Part 1, he still hasn’t found out that Sophie is the lady in silver; he asks her to be his mistress without realizing she’s the same woman from the masquerade.