On any given weekday, there is a statistically significant chance that Eric Adams, the mayor of America’s largest city, will be conducting official New York City business next to the upturned tail of the famed “Charging Bull” sculpture, engaging in what appears to be one of his favorite activities: Raising flags.

He does it with such frequency that it borders on obsession: Since taking office in January 2022, Mr. Adams has raised flags for at least 31 countries representing 16 percent of the United Nations’ member states. He has honored some places twice: Haiti, Ireland, Ukraine and the Philippines.

His flag-raisings are not limited to countries. He has also raised the flags for one U.S. territory, two transnational organizations and one holiday, Juneteenth.

If he keeps his current pace, Mr. Adams is on track to raise flags for roughly 80 percent of the world’s countries by the end of 2029, should he win a second term in 2025 and serve it to completion.

At these ceremonies, Mr. Adams often extols certain characteristics that he attributes to the nation whose flag he is raising, characteristics that happen to be strikingly similar to each other, and to the mayor’s politically moderate, law-and-order brand.

To Filipino Americans, the mayor said: “You believe in families. You believe in business. You believe in public safety.”

To Croatian Americans, he said, “You believe in family, you believe in business, and you believe in public safety.”

And to Kazakh Americans: “You understand the power of education, you believe in public safety.”

Several top aides to Mr. Adams’s predecessor, Bill de Blasio, could not recall him leading a flag-raising ceremony to honor a foreign country; Stu Loeser, a spokesman for Michael R. Bloomberg, who served three terms as mayor, said the same.

For Mr. Adams, flag-raisings are a proven audience-pleasing tactic, one that he honed over two terms as Brooklyn borough president, a largely ceremonial position. He has embraced the practice as mayor, with an even broader political purpose in mind.

By honoring as many ethnic groups as possible in this city of immigrants with a flag-raising in the city’s oldest park — by the haunches of the nation’s most famous bronze bovine — Mr. Adams can woo voters in advance of his 2025 re-election bid. In 2021, he won the Democratic primary by just 7,200 votes.

“When you do an analysis of how close our election was,” the mayor said at a February flag-raising for Saint Lucia, the birthplace of 10,500 New Yorkers, “you begin to really benefit and understand how 10,000 people unified together can send a powerful message.”

That Mr. Adams’s office devotes so much effort to this sort of thing has become the subject of bemusement among New York’s political class. They acknowledge that the implicit political rationale makes sense, and that it is always fun to attend events where people say nice things about you and honor New York City’s diversity. But they argue that the mayor’s time is limited, and he is facing no shortage of problems: rampant homelessness, an influx of migrants, an affordable housing crisis, the erosion of the city’s tax base.

Indeed, a flag-raising for Belgium was scheduled for an hour after the mayor announced new restrictions on how long asylum seekers could stay in city shelters amid a record-breaking homelessness crisis. A flag-raising for Guyana came the same day the city’s first female police commissioner, Keechant Sewell, abruptly resigned because she felt the mayor had undermined her authority.

“As someone who represents a very diverse district, I understand the desire to make every New Yorker feel like their heritage is valued,” said Jessica Ramos, a state senator who attended a flag-raising for Colombia last year. “However, at some point it starts to feel like an empty gesture when taken in the context of other things the city should be doing — filling potholes, picking up trash, funding education.”

The flag-raisings persist because, the mayor says, symbolism matters. And what are flags, if not rectangular pieces of cloth embroidered with symbolic and emotional meaning for sizable portions of New York City’s electorate.

He micro-targets,” said Richard David, a district leader from Queens who attended the mayor’s Guyana flag-raising. “Little things like this for some folks might seem superficial, might feel performative, but if you’re a part of this and being seen for the first time, it does mean a lot. And the mayor knows that.”

In a statement, Fabien Levy, a spokesman for the mayor, cited the city’s multiculturalism and Mr. Adams’s career-long dedication to honoring “these different immigrant communities that make up this city.” Mr. Levy said that participation by members of the mayor’s staff in the flag-raisings was voluntary, and that Mr. Adams took pains to highlight the communities’ shared values.

The mayor’s flag-raising routine has an identifiable rhythm.

His team cordons off the area where the ceremony will take place, just 13 blocks south of City Hall. The events are often underway by the time the mayor’s motorcade arrives. They have something of a pep rally feel.

Typically, a mayoral staff member or close ally steps forward to praise the mayor to a crowd of onlookers with ties to the country whose flag the mayor will hoist. That staff member or ally often has ties to the same country.

When he hoisted the flag for the Philippines in June, Maria Torres-Springer, his Filipina-American deputy mayor for economic development, vouched for the mayor. He “has always been and will always be a true champion of the Filipino community,” she said.

When Mr. Adams raised the Bangladeshi flag, his Bangladeshi-American chief administrative officer, Mir Bashar, also vouched for the mayor, publicly thanking his boss for “his support and tireless efforts and his commitment to improve the lives of all New Yorkers.”

Generally, a consul general attends, alongside representatives from the local community. They often give the mayor gifts: a bracelet, a scarf, a framed painting, socks. He sometimes gives them a mayoral proclamation. Then he repairs to a set of two flag poles, and as the national anthem rings out, he raises the so-called Betsy Ross flag, its circle of 13 stars representing the original U.S. colonies. The foreign national anthem follows, followed by the flag-raising for that nation.

The two flags are each identical in size — 12 by eight feet. To have flags of different sizes would be a breach of protocol, according to John Hartvigsen, a flag historian and former president of the North American Vexillological Association.

To fly another nation’s flag next to the American flag signifies an alliance and honors New York City’s diversity, Mr. Hartvigsen said. But putting one on top of the other on the same pole would be bad, he added, signifying one nation conquering the other.

On a blazing hot day in June, Tara Seetaram, a Guyanese-American who immigrated to the United States 35 years ago, said the mayor’s hoisting of the red-green-and-gold Guyanese flag, known as the Golden Arrowhead, gave her goose bumps.

“It’s beautiful,” said Ms. Seetaram, who was wearing a flag-themed dress her daughter had bought her on Amazon. “It makes me feel that, you know what, we have representation in New York City.”

It was one of the mayor’s eight flag-raising ceremonies in June and July. (The others were for Belgium, the Bahamas, Kenya, the Philippines and Italy, as well as in honor of Juneteenth and The Caribbean Community, a organization of 20 member states.)

On Friday, Mr. Adams raised the Bolivian flag; three more flag-raisings were scheduled for the following week, according to Arthur Piccolo, the chairman of the Bowling Green Association. In his comments on Friday, the mayor seemed eager to defend his presence. He said the events carried a symbolic message to people who left their countries for New York. “I appreciate what you bring to the city,” he said.

Mr. Piccolo said he has been raising flags at the two flag poles since the second flagpole was installed in 1996 — a gift, he said, from the Greek community.

Since then, Mr. Adams has been the only mayor to participate in a flag-raising ceremony at the Bowling Green site, Mr. Piccolo said, asserting that it “was too inconsequential for any previous mayor to care about this.”

After The New York Times contacted Mr. Piccolo, he sent an email to the mayor and his chief adviser, Ingrid Lewis-Martin, praising Mr. Adams for establishing a new tradition he believed future mayors will uphold. Then he forwarded the email to The Times.

“Your dedication and commitment to this simple yet powerful symbolism have not gone unnoticed, and I believe it exemplifies a very, very good use of your time as the mayor of our great city,” Mr. Piccolo wrote.