CHICAGO—Sen. JD Vance   introduced himself to the nation as a son of poor Kentucky coal country with family roots going back generations. Kamala Harris   introduced herself as the child of Indian and Jamaican immigrants, one of them “a brown woman with an accent” who arrived with dreams of becoming the scientist who cured breast cancer.

These details, laid out at the two parties’ national conventions, weren’t just intended to fill in the biographies of the faintly known Republican nominee for vice president and Democratic nominee for president. Rather, they were part of the two parties’ explanations for why they would take the nation in radically different policy directions.

The two presidential campaigns, at the conventions and in other messages, have offered far different visions of what it is to be American, part of a battle over which agenda serves the nation best. To Vance, the “source of American greatness” is the bonds built over generations of people connected to their “homeland,” which he said must be defended against imported foreign labor, imported energy and trade deals that shipped jobs overseas. To Harris and her allies, the American story is often about people overcoming racial and economic hurdles, whose aspirations deserve targeted aid from the government.

Donald Trump , the GOP presidential nominee, has prominently taken up the debate over American identity by portraying Harris herself and her policies as outside the mainstream.

Deriding her economic plan as a form of Soviet-style governance, he has continually dubbed her “Comrade Kamala’’ and recently posted an image online casting the Democratic convention as a communist rally, with Harris as its leader. He has falsely contended that she took on her Black identity only recently, suggesting she is deceitful in presenting herself to the public.

Former President Donald Trump accepting the Republican nomination during the fourth day of the Republican National Convention last month. Photo: Sophie Park for WSJ.

“He’s trying to ‘other’ Harris”—make her seem alien in her identity and values, said Sarah Longwell , a Republican strategist who opposes Trump. She said Harris had responded in the convention by “leaning into what it means to be an American, how American she is, how she’s a unique American story. And that’s how you overcome, I think, his attempts to ‘other’ her.”

Trump has also proposed the largest mass deportation program ever of people in the U.S. illegally, describing them as a threat to safety and the American way of life.

Vance, meanwhile, used the GOP convention to tell the story of a family rooted to the land for generations, using it to argue in part for protecting the nation’s native-born citizens and their values.

Vance talked about the cemetery in Eastern Kentucky, near his family’s ancestral home in one of the nation’s poorest counties, where he expected to be buried one day next to people born at the time of the Civil War. He put the shared history of the people there at the center of his vision of America.

“America is not just an idea,” Vance told the Republican convention. “It is a group of people with a shared history and a common future.” While accepting immigrants is part of the American tradition, he said, “when we allow newcomers into our American family, we allow them on our terms. That’s the way we preserve the continuity of this project from 250 years past to hopefully 250 years in the future.”

Harris’s convention speech, by contrast, leaned into the idea that her story of a first-generation, biracial child advancing to high office embodies America’s promise of offering opportunity to all.

Vice President Kamala Harris accepting the Democratic nomination at the Democratic National Convention last week. Photo: Sophie Park for WSJ.

Harris has proposed a sweeping package of tax cuts for parents, aid to first-time home buyers and access to capital for small-business owners that she suggested would help people who had few chances for advancement. “Opportunity is not available to everyone,” she said she learned as a child. “That’s why we will create what I call an opportunity economy, an opportunity economy where everyone has the chance to compete and a chance to succeed.”

The two party conventions also offered a more direct engagement in the battle to define American identity. When Hulk Hogan , the retired WrestleMania star, took the stage shortly before Trump accepted the GOP nomination, he wore a shirt that said “Real American.” He then explained what the term meant to him.

“I found out I was in a room full of real Americans,” he said, referring to the convention hall and the loyalty of GOP delegates to Trump. “When Donald J. Trump becomes the president of the United States, all the real Americans are going to be nicknamed Trumpites, because all the Trumpites are going to be running wild for four years,” he said.

Democrats left it to Barack Obama to give the reply. “Donald Trump wants us to think that this country is hopelessly divided between us and them, between real Americans who of course support him and the outsiders who don’t,” the former president told his party’s convention . He urged the audience to reject that idea.

Democrats also responded by trying to paint Trump as the candidate who is outside the mainstream, given his efforts to denigrate Harris and her policies. Michelle Obama , among others, presented Harris’s life story as an example of America’s promise, rather than foreign to it. “It’s the story of the vast majority of Americans trying to build a better life,” the former first lady said.

She added: “No one has a monopoly on what it means to be American.”

The convention also put Harris’s great-nieces on stage to explain the correct way to say the candidate’s first name (it is COMM-a-lah)—an implicit rebuke to Trump, who often mispronounces the name and has said “I couldn’t care less” about doing so.

Kamala Harris’s great-nieces on stage at the Democratic National Convention in Chicago. Photo: Gabriella Demczuk for WSJ.

Michelle Obama went further and tried to flip the script on claims by some Trump allies—and amplified by Trump himself—that Harris is a “DEI candidate,” a claim rooted in the belief that minority groups unfairly use racial preferences to advance. She implied that it was Trump who had received special preferences based on his birth that aren’t available to others.

“We will never benefit from the affirmative action of generational wealth,” she said.

Vance concluded his speech by saying his family represents “generations of people who have fought for this country, who have built this country, who have made things in this country,” and whose commitment to the country is more concrete than an abstraction or idea. He said that “America is a nation, and its citizens deserve leaders who put its interests first,” whatever the color of their skin.

Republican presidential nominee Donald Trump with his family at the end of the Republican National Convention. Photo: Gabriella Demczuk for WSJ.

The following night, Trump expanded on the details of putting those interests first, promising “massive tax cuts for workers” and new tariffs on imports, among other measures. “We will not let countries come in, take our jobs, and plunder our nation,” Trump said.

His vision of improving America centered in large part on protecting its territorial integrity. He said he would secure the border and deport undocumented immigrants, who he said made the nation more dangerous and who squeezed Black, Latino and union workers out of their jobs. Previously, Trump had accused Biden, without evidence, of allowing migrants into the country to “sign them up to get them to vote in the next election.”

“At the heart of the Republican platform is our pledge to end this border nightmare, and fully restore the sacred and sovereign borders of the United States of America,” he said.

Balloons fall to mark the end of the fourth day of the Democratic National Convention in Chicago. Photo: Sophie Park for WSJ.

Write to Aaron Zitner at aaron.zitner@wsj.com