Tipped off by her Washington sources that an executive order blocking refugees was coming, Becca Heller fired off messages to her vast network of law students and pro bono lawyers:

Tell any clients who already have visas to board a plane for the United States. Get ready for the possibility that they will be detained upon landing.

“URGENT-Protect refugees arriving at airports,” she wrote in an email blast on Jan. 25.

So when President Trump signed the order two days later, and thousands of lawyers flocked to airports in New York, Chicago, Los Angeles and elsewhere, the public saw not so much a spontaneous reaction as the meticulous preparation of a loud, pugnacious 35-year-old lawyer who is now in the middle of one of Mr. Trump’s biggest policy fights.

On Monday, the nonprofit that Ms. Heller began eight years ago as a student organization at Yale Law School, and that has helped more than 3,000 refugees resettle in the United States, will try to continue its winning streak against the Trump administration in a federal appellate courtroom in Virginia. The government is trying to overturn a lower-court victory by the organization that blocked the second version of Mr. Trump’s travel ban, calling it an unconstitutional discrimination against Muslims.

After Mr. Trump’s election, she said, “I started thinking increasingly in military terms, so I was like: ‘What does it mean that we have an army of 2,000 lawyers who want to do stuff for refugees? What can we do with that?’”