Sophia didn’t really mean to keep helping out the Brotherhood of Steel. It just so happened that a lot of the things she had already planned on doing were things that they needed to be done. Clearing out nests of Super Mutants from downtown and ghouls from old subway tunnels made travel more efficient for the Minutemen and the populace of the Commonwealth in general.
The reputation it gave her was just a nice bonus. People began to talk and the Brotherhood of Steel took notice of that. Danse was the first that she met, as the leader of their scouting party.
As much as she hated to admit it, she found him to be charming. He was both very similar to Nate and very, very different. He didn’t depend on his Power Armor like she figured many of the others might. He was a formidable fighter, well-disciplined, and appropriately polite.
He was also stubborn and uncompromising. It was difficult to change his mind about anything no matter how much evidence was given that he was incorrect in his assumptions which led to many screaming matches after the defeat of the institute and the (re)structuring of the Commonwealth.
It was too bad for Danse that Sophia was just as equally uncompromising and stubborn as he was. She was used to winning arguments and her expertise being unquestioned. He might have been disciplined and strategically minded but so was she.
As a strategic and disciplined team, they helped to build something beautiful with the Commonwealth, and through their contentious teamwork they became friends which was indeed a happy accident.