Those grievances have faded, though the two have never spent much time in each other’s company — they and their husbands last dined together at the White House in 2013 — and friends do not describe the two women as close.
But their fates have become increasingly intertwined. Much of President Obama’s legacy rests on America choosing Mrs. Clinton as his successor. And for that to happen, Mrs. Clinton will need the kind of public affirmation from the White House that no one can convey more forcefully than the first lady.
Delivering one of the most stirring speeches Monday night at the Democratic National Convention before a sea of delegates waving purple signs that read “Michelle,” she urged the party to do for Mrs. Clinton what they did for her husband.
“When crisis hits, we don’t turn against each other. No, we listen to each other, we lean on each other, because we are always stronger together,” Mrs. Obama said. “I am here tonight because I know that that is the kind of president Hillary Clinton will be.”
The first lady said Americans must choose a president who will be a good role model for children, with the power to “shape our children for the next four or eight years of their lives.”
“Our friend Hillary Clinton,” she said, is the only candidate in the race she trusted with that responsibility.
In her speech, Mrs. Obama roused the convention hall into a frenzy by denouncing Donald J. Trump without ever using his name. She mocked his frequent use of Twitter, called him thin-skinned and questioned whether he has any real knowledge of policy.
And she forcefully urged the audience and the television viewers to reject Mr. Trump’s campaign motto, casting it as a cynical description of a country in crisis that she does not recognize.
“Don’t let anyone ever tell you that this country isn’t great, that somehow we need to make it great again,” she said. “This right now, is the greatest country on Earth.”
When Mrs. Obama, her top aides and her chief speechwriter huddled over the last week to draft her address, they did so against the backdrop of a complicated and evolving relationship between two of the nation’s most prominent women.
The beginning of a rapport between the women started when Mrs. Clinton called to compliment the future first lady in 2008 after Mrs. Obama delivered her convention address that year. They did not see each other much over the next few years, as Mrs. Clinton kept a hectic schedule of overseas travel as secretary of state.
Mrs. Obama began a tradition of attending the State Department’s International Women of Courage Awards ceremony each year while Mrs. Clinton was the secretary. In 2010, Mrs. Obama tripped over her words as she thanked “my dear friend, Senator — Secretary Clinton.” The crowd laughed as Mrs. Obama added, “I almost said, ‘President Clinton,’” shooting Mrs. Clinton a sly smile.
Certainly, the two imagined the job of first lady differently. Michelle Obama rejected the partisan political role that Hillary Clinton pioneered in the East Wing, instead embracing the job’s ceremonial trappings and family-friendly issues — nutritional standards and benefits for veterans — more common to first ladies.
That careful, traditional approach helped turn Mrs. Obama into the most popular person in the Obama White House, a kind of pop-culture heroine with little of the polarizing image or political baggage that hounded Mrs. Clinton.
Sam Kass, a close friend of the Obamas who served as the family’s personal chef for six years and as the White House senior adviser for nutrition policy, said that Mrs. Obama had learned from Mrs. Clinton’s experience as a spouse living in the spotlight. He said the former first lady had rejected parts of the traditional role, and it sometimes got her into political trouble — for example, when she led her husband’s failed effort to overhaul the nation’s health care system.
Mrs. Obama and her advisers decided to try striking a more careful balance between ceremony and policy, Mr. Kass said.
“Sometimes, you needed to show off the china,” he said. “But other times you needed to push private industry to do better, and fight with Congress.”
Mrs. Obama occasionally generated controversy as first lady, drawing criticism from conservatives for her efforts to reshape the country’s nutritional rules. She faced off against food industry executives who resisted her attempts to make their products healthier.
But most of her efforts — the “Let’s Move” campaign for childhood exercise and the “Let Girls Learn” international education program, for example — have drawn bipartisan praise.
In the meantime, she has become a hit on the television talk show circuit and on the internet.
A video of her singing along to Stevie Wonder and Beyoncé in a “Carpool Karaoke” segment last week with the British television host, James Corden, has been viewed more than 30 million times.
On Monday night, in what could be the last time she speaks to a large, national television audience, Mrs. Obama sought to shower some of her popularity on her predecessor.
The speech was prepared in collaboration with Sarah Hurwitz, who was Mrs. Clinton’s speechwriter in 2008, and was responsible for the concession speech where Mrs. Clinton said that her supporters had made “18 million cracks” in the glass ceiling.
Since then, Ms. Hurwitz has been Mrs. Obama’s primary wordsmith — and, in a small way, Melania Trump’s. In her speech last week, Ms. Trump, the Republican nominee’s wife, appropriated several lines from Mrs. Obama’s 2008 convention speech that had been written by Ms. Hurwitz. Ms. Trump’s speechwriter later apologized.
Aides said Mrs. Obama and Ms. Hurwitz traded drafts of Monday’s speech several times in the last week. They met in the first lady’s East Wing office with other top aides to go over Mrs. Obama’s edits, handwritten in the margins of the drafts or sent to the group in an email.
After the convention, the first lady’s aides said, she will actively campaign for Mrs. Clinton. But even when the candidate was her husband, Mrs. Obama put limits on how much time she was willing to devote to the campaign trail because of family obligations.
“I’m absolutely fired up,” Mrs. Obama said in an interview in February 2012, “but I always have to have balance, because I’m a mother. When I’m out there, I’m fired up, but when I’m not, I have to be Malia and Sasha’s mom, and that can’t be as a fired-up campaigner. They’re like, ‘Where were you?’”
On Monday night, Mrs. Obama brought up her children in hailing Mrs. Clinton’s role in breaking down barriers, just like her husband did.
“I wake up every morning in a house that was built by slaves, and I watch my daughters, two beautiful, intelligent black young women, playing with their dogs on the White House lawn,” she said. “And because of Hillary Clinton, my daughters and all of our sons and daughters now take for granted that a woman can be president of the United States.”