In 2355, she was the prosecutor in the court martial of Captain Jean-Luc Picard. Picard had been charged in connection the loss of the USS Stargazer, which Louvois relentlessly prosecuted. Picard was later absolved of all charges, but his relationship with Louvois remained strained after the court-martial.
Picard and Louvois apparently had some sort of relationship that was more than just friendship, with Louvois commenting a decade later that Picard was still "a damn sexy man."
Shortly after the Stargazer court-martial, she resigned from Starfleet, but returned subsequently.
Picard challenged the ruling on behalf of Data. Louvois' new office being short-staffed, Picard was appointed as Data's defense counsel, with Commander William T. Riker forced to advocate for Maddox's position, at peril of having Louvois' adverse preliminary summary ruling stand. Louvois, as magistrate, ultimately agreed with Picard that Data was not the property of Starfleet--and, indeed, had the right to choose. (TNG: "The Measure Of A Man")
Phillipa Louvois was played by Amanda McBroom. The character is one of the very few staff Captains (non-command) to appear in any Star Trek production. Other staff captains include Montgomery Scott, holding the rank of Captain while serving as a Chief Engineer in the Star Trek films, and Captain Krasnovsky who was apparently a Captain in the sciences division. Spock held command of the Enterprise in Star Trek II and Star Trek VI, but also served as a staff captain at other times during the events of Star Trek II and Star Trek VI.
Louvois' background is visited in the novel The Buried Age, wherein she has an intimate relationship with Picard just before he turns 50. She is assigned to prosecute Picard during the court-martial, and is so desperate to prove her case that she betrays Picard, mentioning that he wakes up yelling the names of those officers that were lost in the destruction of the Stargazer, to bolster her position that Picard felt personal responsibility and remorse for the loss of the Stargazer, in order to better prove her objectivity. Louvois' supervisor seriously reprimands her for the ethics violation, noting that going to those lengths to make a point about her own abilities will make it hard for anyone to trust her, causing her to resign her commission.