Super Bowl ads cost a fortune. So when a group backing the presidential bid of Robert F. Kennedy Jr. ran a 30-second ad for him during Sunday night’s game, the political world took notice.

How had the super PAC of a long-shot independent candidate paid for such a costly spot, and whose idea was it to adapt a vintage John F. Kennedy ad for his nephew’s campaign?

A major source of the funding — and the creative guidance — it turns out, was Nicole Shanahan, a lawyer, entrepreneur and Democratic donor who was once married to the Google co-founder Sergey Brin.

In an interview on Monday, Ms. Shanahan said she had given $4 million to the super PAC, American Values 2024, about a week before the game, for the express purpose of helping pay for a Super Bowl ad. She also helped coordinate the ad’s production, she said, including navigating concerns from CBS Sports and Paramount, which broadcast the Super Bowl.

“It seems like a great opportunity to highlight that he’s running for president,” Ms. Shanahan said. She said part of her motivation was concern about the environment, vaccines and children’s health, and her belief that Mr. Kennedy was willing to challenge the scientific establishment.

“I do wonder about vaccine injuries,” she said, although she clarified that she is “not an anti-vaxxer,” but wanted more screening of risks for vaccinations. “I think there needs to be a space to have these conversations.”