Pop stars – especially women – are frozen at the age they become famous. Breaking the ice usually involves a bad-girl reinvention, if not a genuine breakdown. Somehow, this tension never affected Avril Lavigne, the Canadian pop-punk star who arrived in 2002 aged 17 with the brilliant Complicated, a heaving teenage sigh directed at some poseur boy. It’s not that she didn’t have an indelible look: her low-slung skate pants, tie and ramrod-straight hair are an enduring fancy-dress costume. It’s that she never seemed to want to grow up.

Her alternately fun, angsty debut album, Let Go, seemed authentic enough – she played guitar! The lyrics were handwritten! – to convince a generation of teenage girls that she, and by association, they, were more credible than Britney. Then 13, I was one of them; I wore Dad’s tie to the shops and wasted hours learning how to copy her handwriting. It was music many quickly graduated from, to acts whose credits didn’t list multiple co-writers: the drug of authenticity hooks teenagers fast. But there is no shame in being a gateway artist, a role Lavigne seemed surprisingly happy to keep playing.

After an emotionally intense second album, she seemed to dial back the years with 2007’s The Best Damn Thing, led by single Girlfriend, a Hey Mickey-style rager about homewrecking. Goodbye Lullaby (2011) had What the Hell (“All I want is to mess around”) and her 2013 self-titled album boasted Bitchin’ Summer (ie School’s Out with swearing) and Here’s to Never Growing Up (“We’ll be running down the street, yelling, ‘Kiss my ass’”). She was 29. A year later, she started feeling inexplicably exhausted. Doctors tried to diagnose her with anxiety and chronic fatigue, even though she was sure she had Lyme disease. Finally, she got a vindicating diagnosis and spent two years in bed on antibiotics, certain, at one point, that she would die.

What happens when a teenage immortal faces death? Lavigne, now 34, doesn’t want to talk about that. “It was a relief” to get the diagnosis, she says tersely, calling from Los Angeles. “I was like: ‘OK, now I can at least start treating something.’” She was treated at home. Who cared for her? Her manager interrupts and insists we “really focus on the music”. But it is hard to separate Lavigne’s illness from her sixth album, Head Above Water, named after a song that came to her as she lay in her mother’s arms, feeling as if she was drowning. It is her best song in years, an emphatic, gothic ballad that is doing well on the US Christian singles chart and has 57m YouTube views. “It just felt really good to be singing,” she says. “The emotion was so raw.”

Despite Lavigne’s illness, she says she never doubted her capacity to commit to a whole album. She started writing on guitar in bed, graduating to piano when she felt stronger. Inner strength is the prevailing theme of the eight songs I heard, which often evoke Lana Del Rey’s moody epics. Empowerment anthems like this were everywhere a few years ago, but have been replaced by stark admissions of vulnerability and nihilism. But keeping pace with pop wasn’t Lavigne’s concern. “I didn’t want to do what everyone was doing,” she says, mentioning a need for “organic musical realness” and constructing songs around her vocals “versus building this crazy loud track and just burying a vocal in it”. This is the kind of dry “focus on the music” Lavigne prefers. She keeps saying how “meaningful” the music is, but won’t go deeper.

Other songs allude to a toxic relationship. All Lavigne will say is that my assumption is “obviously” correct and that they’re categorically not about her second ex-husband, Nickelback frontman Chad Kroeger; they have a “great relationship” (he worked on the album). “I appreciate you trying to really get the juice,” she says mockingly, “but I’m not gonna go there.” I explain that I’m not looking for gossip, but context for her most personal album. “That’s the thing about my music,” she says, exasperated. “I write it and I put it out there, and people can interpret it the way they like.” It is hard to talk about the music when the music apparently speaks for itself.

But maybe never showing vulnerability is key to Lavigne’s 17-year pop career. She has heartfelt songs – her debut album’s I’m With You is a fantastic pop-rock ballad, later sampled by Rihanna – but her exterior has swung between feckless (giving the finger on MTV’s era-defining Total Request Live in 2004) and brittle. (She regrets the tearful 2015 television interview announcing her illness.) She is publicly close to both her ex-husbands, Kroeger and Sum 41 frontman Deryck Whibley, whom she met aged 17, married at 21 and divorced at 25.

Pop is built on female resilience, which seems to have come naturally to her. When asked whether sexist and derisory criticism affected her as a teenager, she is unimpressed: “I don’t know what you’re referring to.” The stories she told about Limp Bizkit’s Fred Durst trying to sleep with her; the manufactured feud between her and Britney Spears? “Oh, that’s OK,” she says, flippantly. “It’s just because I was superpowerful and they needed gossip to talk about.” Her debut sold more than 6m copies in a year and she toured the world. Did she always feel protected as a teenage girl in a cutthroat industry? “It was a whirlwind, and it was so magical and unbelievable.” The only gruelling parts were the “different time zones and travelling”.

What seemed less natural as her career progressed was Lavigne’s actual identity. The driven 15-year-old from smalltown Napanee, Ontario, was discovered singing country songs in a bookshop. A year later, she moved to New York with her older brother after a Canadian label sent footage of her singing karaoke to a producer. Two months after turning 17, she was signed by pop impresario LA Reid. In Lavigne’s telling, Arista thought they had a Sheryl Crow-style country act on their hands, but she wanted to write heavier songs. A compromise was reached: after writing rockier material with one co-writer, she was paired with LA trio the Matrix, who wrote Let Go’s three massive singles, Complicated, Sk8er Boi and I’m With You. Lavigne and Matrix disagree about the level of her input on the album. Reid maintained “whatever gets the job done” diplomacy.

The first album was so successful that Lavigne says she only had six months to write 2004’s Under My Skin: “They made me put it out before I was ready.” She and co-writer Butch Walker kept writing until the last minute, producing the bittersweet grunge anthem My Happy Ending. “I called them and I said: ‘Guys, I have the first single.’ They’re like: ‘No, we’re going with Don’t Tell Me.’” Arista led with their choice but Lavigne was right: My Happy Ending peaked higher and sold almost three times as many copies.

The brooding Under My Skin reflected the kind of progression that makes sense, especially for a pop star who stressed her autonomy at a time when girls weren’t afforded much of it. Which is why her third album, The Best Damn Thing, seemed so odd. Her first for a new label, RCA, it was a riotous pop record led by the deadpan cheerleader banger Girlfriend, her only US No 1 single to date.

Like Gwen Stefani, Lavigne has always been conservative despite her punk image. Her family are devoutly Christian. She once described girls “having sex with a ton of boys” as “a bad thing”, a belief that informed Don’t Tell Me: “Did I not tell you that I’m not like that girl, the one who gives it all away?” By the time she released The Best Damn Thing, the Disney-pushed purity-ring craze dominated pop. But even that couldn’t explain the album’s regressive lyrics: “You left without me and now you’re somewhere out there with a bitch, slut, psycho babe,” she sang on Everything Back But You. On the title track, she moaned about how she hated it when a guy “doesn’t get the door”, “doesn’t get the tab”, “doesn’t understand why a certain time of the month I don’t wanna hold his hand”.

In retrospect, it would be a relief to blame the album on its producer and co-writer, Dr Luke, who made his name creating debauched hits for the era’s female icons, and lost favour after former protegee Kesha accused him of abuse. (He denies all claims and is suing for defamation.) But Lavigne enjoyed working with him: “We wrote really great songs together.” These three albums were the only records – until now – where she didn’t have to compromise. “It was the fourth album when the tears started,” she says.

“The majority of the time in my career, [RCA] want me to write another Girlfriend. They don’t want the ballads.” It seems especially tragic that on 2011’s otherwise lovelorn Goodbye Lullaby – written following her split from Whibley, although he produced half of it – she had to include What the Hell, a song about snogging a guy’s friends and going “on a million dates” that sounded unfortunately similar to the then ubiquitous Disney pop-rock she had inspired.

“It’s difficult to be a woman and to be heard, and people sometimes don’t take you seriously,” she says, finally warming to a subject. “I’m highly intuitive and I’ve always got a very strong gut feeling. I’ve always felt that I’ve known what’s best for me to do and I’ve had to fight different people on this journey over those 17 years: ‘You need to do this and it needs to go Top 40.’ You make those songs cos you have to, but then the stuff that’s the best on record is the album tracks.”

It sounds miserable. “I would get some songs the style I really wanted,” she says. “I always loved the pop-rock thing and it’s still who I am. I’m still proud of those songs and I wrote them. It wasn’t like people wrote them and gave it to me. It was like: ‘OK, I get it. You guys want singles that are going in this direction. Fine, I’ll work with you but I’d rather be doing something else.’ You can’t be stubborn and just do everything your own way.”

If commercially inclined compromise is one of the secrets of Lavigne’s enduring career, it remains at odds with the delinquent attitude of many of her songs. That was the mood on her 2013 self-titled album, which dwelled on teenage rebellion and contained a J-pop-influenced song about Hello Kitty that many deemed racist on seeing its stereotype-laden video. (She denied the suggestion, citing the Japanese production crew.) Claims of cultural appropriation aside, its lyrics fared little better. Referencing Spin the Bottle and “roll[ing] around in our underwear”, it sounded like a middle-aged pervert’s idea of teenage sleepovers.

“The label didn’t tell me what to write, lyrically,” she insists. “I’m young at heart. I’m a free spirit. I’m super-fun. I love to hang out and have fun and dance and skateboard.” She reels off the diverse types of song she can write “in my sleep”: about love, breakups, partying, dancing, rock’n’roll, friendship. “I’m a fucking rock star, bitch!”

Perhaps it’s a sign of how effectively Arista marketed Lavigne’s debut that you want to believe there was a frustrated artist in there all along. Two years ago, a conspiracy theory that Lavigne had died and been replaced by a doppelganger went viral. It was absurd, and must have been extremely hurtful for Lavigne to witness people laughing about her hypothetical death when her health was so precarious. Beyond the delight of a well-reasoned crackpot theory, I don’t think people were gloating about her demise, but attempting to make sense of her jarring career: surely these artists weren’t the same person?

Musically, maybe Head Above Water is what will finally kill off the teenage immortal. She switched labels, to BMG, whom she said treated her like a “legacy artist”. “That was the first time, other than my first album, that a label really just was like: ‘Take your time and write the music that you want to write.’”

It would be easy, after our fairly painful encounter, to want to pin the baffling mid-portion of Lavigne’s career on her alone. But the self-evident results of a label’s overdue trust – a stronger album with real emotional stakes and sophisticated ambitions – should embarrass an industry that prefers its women powerless and pickled in aspic.