Reese Witherspoon arrives at the Los Angeles premiere of “Wild” in Beverly Hills. (Richard Shotwell/Invision/AP)

Celebrity scandals work in mysterious ways. Just take the case of Reese Witherspoon.

In April 2013, the Oscar-winning actress was arrested for disorderly conduct in Atlanta after her husband, Jim Toth, was pulled over and arrested for suspicion of driving under the influence. She pulled the “Do you know who I am?” card with the cop, all captured on tape, much to the delight and mockery of Internet commenters everywhere. Witherspoon issued a shamefaced apology, but everyone wondered: Would this ruin not just the reputation but the career of the sunny America’s Sweetheart?

As it turned out — not even a little bit. If anything, it propelled her to a more endearing image as she embarked on a grittier phase of her career, highlighted this weekend with the release of “Wild.” The film is based on Cheryl Strayed’s emotionally devastating 2012 memoir about her grueling 1,100-mile solo hike after the death of her mother and destruction of her marriage. Witherspoon, 38, is already getting rave reviews and Oscar buzz for throwing herself into the difficult role, which required raw scenes of sex and drug abuse. In the past several months, she also won praise for her roles in the indie films “The Good Lie” and “Mud,” while being declared a behind-the-scenes genius for executive-producing the hit “Gone Girl.” This is Reese Witherspoon 2.0, and she’s flying higher than ever.

What helped her move so easily into her “Wild” role is that the former Nashville debutante had not, in fact, held the “America’s sweetheart” title for as long as you may think. Breaking into Hollywood at age 14 with “The Man in the Moon,” Witherspoon originally made her name with a double dose of dark teen drama: “Cruel Intentions” and the wry “Election” in 1999. In the latter, Witherspoon played social/political climber Tracy Flick with a vengeance, unleashing a dose of sharp energy.

It was only then that she ascended to the A-list, reinvented as a perky ingenue. In 2001’s “Legally Blonde,” Witherspoon masterfully played a ditzy blonde sorority girl-turned legal star to much applause. She cashed in with international hit “Sweet Home Alabama” in 2002 (about a woman torn between Southern roots and her city life) and a reported $15 million paycheck for “Legally Blonde 2” the year after. Throughout this phase, Witherspoon’s image was clear: A sweet-yet-sassy steel magnolia you just can’t help but root for.

“Reese is cute, she’s huggable, she’s bubbly,” MTV gushed in 2002. Her “Sweet Home Alabama” co-star Patrick Dempsey declared “she’s America’s sweetheart” — yes, that phrase again — “but with a bit of an edge.” Her career chugged along into more adult roles and won an Oscar for her portrayal of June Carter Cash in 2005 biopic “Walk the Line.”

Then, just as her career was at its peak, everything seemed to go wrong: Follow-up movies like “Four Christmases,” “How Do You Know” and “Water for Elephants” failed to make a mark. Tabloids jumped on her divorce from Ryan Phillippe, father of her first two children. Witherspoon dropped out of the public eye for awhile, save for celebrity magazine stories about her wedding to second husband Toth in 2011 and their new baby son late the following year.

"Wild" is based on a New York Times best-selling memoir that chronicles Cheryl Strayed's (Resse Witherspoon) 1,100-mile hike up the Pacific Crest Trail. (Fox Searchlight)

And all of a sudden, there was that arrest — a media sensation, in part because it cut against her image as a super-controlled goody-goody. Celebrity analysts fretted: “She has always come across as humble and sugary sweet, but now she has left some fans with a sour taste in their mouths,” one told the New York Daily News. “One incident like this won’t damage her good-girl image permanently, but if more incidents like this occur, she may lose the love and support of fans.”

Instead, fans were more endeared than ever to see the flawless star’s feet of clay. She was human after all! “With Witherspoon’s bad night in Atlanta, we got a hint of the passion and anger simmering beneath that perfect veneer,” The Reliable Source wrote at the time, noting there were many celebrities who went on to have a career boost post-scandal.

Indeed, Witherspoon was back on the radar this year, and on fire. Forget about all those canned magazine interviews she used to give: In May, supermodel Cara Delevingne posted a video to Instagram showing Witherspoon giving some salacious advice to a group of stars after the Met Gala in New York City.

It was quickly deleted; we lamented why her handlers couldn’t see how much more ingratiating she was when letting her hair down. Months later, a video of Witherspoon rocking out at a wedding went viral, making it clear that fans can’t get enough of the unmediated Reese. Maybe the “America’s sweetheart” label had gone stale — or maybe it was never the right fit for her in the first place.