The race to define Vice President Kamala Harris began in earnest on Tuesday, with both her campaign and former President Donald J. Trump’s team unveiling television advertisements that aim to explain her biography to voters in battleground states.

Ms. Harris’s new ad, her first since becoming the party’s de facto nominee, labels her as “fearless” while leaning into her time as a local and state prosecutor. “She put murderers and abusers behind bars,” a narrator states. “Kamala Harris has always known who she represents.”

Mr. Trump’s new ad, meanwhile, attacks her as being weak on the border. It suggests that she is responsible for millions of border crossings and a quarter-million deaths from fentanyl, which the ad says occurred “on Harris’s watch.” It closes with a new Trump tagline for Ms. Harris: “Failed. Weak. Dangerously Liberal.”

Just over a week ago, Ms. Harris replaced President Biden as the Democratic Party’s standard-bearer. Despite being the vice president and having represented the nation’s largest state as one of California’s senators, Ms. Harris is relatively unknown by many of the voters in battleground states who are likely to decide the presidential election.

The new ads will cost tens of millions of dollars and run in those key states.

Ms. Harris’s spot is the beginning of what her campaign has said is a $50 million blitz before the Democratic National Convention, which begins on Aug. 19 in Chicago. (The campaign has announced roughly the same amount of ad spending in the previous several months.)

The Trump campaign is spending more than $12 million across Arizona, Georgia, Michigan, Nevada, Pennsylvania and Wisconsin over the next two weeks, according to data from AdImpact, a media-tracking service — its first major television ad purchase since Mr. Biden made way for his vice president.