When Ray of Light dropped on Feb. 22, 1998, the world was already used to the idea of Madonna reinventing herself with each album. But even so, the Madonna Ciccone revealed on Ray of Light was a breathtaking departure from everything that had come before. Instead of pushing boundaries and pressing society's buttons with the smirk of a precocious child, the then-39-year-old singer was looking inward -- and for the first time, she was admitting she didn't necessarily like what she saw. For a pop star and songwriter defined by her ferocious confidence, Ray of Light showed us that after conquering the world, Madonna still had doubts.

"I traded fame for love, without a second thought / It all became a silly game, some things cannot be bought,” Madonna intones at the start of the album over an impossibly lonely ambient soundscape. “I got exactly what I asked for / Wanted it so badly / Running, rushing back for more, I suffered fools so gladly / And now I find, I've changed my mind."

While Madonna’s previous studio album kicked off in a similar navel-gazing fashion, Bedtime Stories’ opener “Survival” was all about resilience and perseverance. “Drowned World/Substitute for Love,” however, finds Madonna sounding dispirited and dissatisfied with what she’s become (hey, did you expect a song with TWO depressing titles to be an exuberant dance anthem?). But Madonna being Madonna, that doesn’t translate into self-pity -- instead, it’s a jumping off point for her evolution in both sound and spirit, brilliantly setting up the narrative of the most contemplative album of her career. On Ray of Light, she's reached the top, but she's still empty -- and she's wondering what's next.

Over the course of 13 tracks, Madonna takes us through her journey to self-realization, touching upon Eastern philosophy ("Sky Fits Heaven”), yoga (“Shanti/Ashtangi”), the birth of her first child, Lourdes ("Little Star"), regrets over her past ("Candy Perfume Girl"), and lost love ("The Power of Goodbye"). Of course “Ray of Light” remains one of the most joyous entries in her catalog, but the bulk of Ray of Light is marked by introspection. And significantly, the album’s minimalist closing track, "Mer Girl,” offers no answers or solutions as Madonna confronts mortality and a life haunted by her mother’s death: “I ran and I ran, I was looking for me… I ran and I ran, I’m still running away.” On Ray of Light, the sagacity is Socratic -- Madonna doesn’t have the answers, but she knows it; and that’s what makes this her wisest work to date. (And that maturity wasn’t just lyrical: Thanks to the rigorous vocal training she’d taken to hone her craft for her Golden Globe-winning role in Evita, Madonna's vocal control had never been more nuanced and full-bodied.)

If Ray of Light was a surprise left-field turn for listeners, one longtime collaborator didn't seem to notice any glaring changes in her behavior when working on the album. Patrick Leonard, who started working with her for her 1985 Virgin Tour and would go on to co-write and co-produce well over a dozen Madonna hits including "Live to Tell," "Like a Prayer," and "Cherish," found the songwriting process for Ray of Light to be fairly similar to what they'd done before.

After sitting out the Erotica and Bedtime Stories LPs, Leonard tells Billboard Madonna reached out to him with a simple proposition: “The premise was, ‘This (partnership) worked really well before, let’s try it again.’ It was just that, it was kind of innocent. If it goes well, we’ll do it, and if it doesn’t, fine...When you do that much collaborating, you just fall right back into it.” For Ray of Light, the process yielded several new songs: the reflective “Sky Fits Heaven,” the philosophic banger “Nothing Really Matters,” the pulsating “Skin” and the massive hit “Frozen.” (He also co-wrote the Japanese bonus track "Has to Be," but admits to barely remembering it: "I did work on it?" Leonard says with a laugh. "Well, that's nice.")

If the songwriting process was familiar, Leonard did, however, notice a change in her literal voice: “The one thing I noticed when we were doing Ray of Light is her singing. She was in a slightly different place singing-wise because of Evita, and I think that influenced some of this stuff for her. There had been a lot of focus on singing for her, and it changed things, but not better or worse, just different.”

Although Ray of Light was his first time writing songs with Madonna, songwriter Rick Nowels -- who met her at the Upper East Side Barneys in Manhattan the evening of Clive Davis’ 1997 Grammys party -- gives an account of working with her that resembles what the lion’s share of her collaborators say: She’s fast, and excessively professional.

“I had a little house up in Mulholland Drive (in Los Angeles) and I had a studio in it, it overlooked the San Fernando Valley,” Nowels says of their writing sessions. “I sat behind the keyboard and she sat opposite me in the living room. And every day she'd show up 3-7: She was always on time, always arrived at 3 and always left at 7. We'd start with nothing and she'd walk out at the end of the day with the song demoed and the vocals cut... I'd start playing and she'd start singing, and these songs happened quickly, maybe a half hour, 45 minutes."

Over the course of two five-day work weeks, the pair wrote nine songs. Three of them -- “The Power of Goodbye,” “To Have and Not to Hold” and “Little Star” -- ended up on Ray of Light, with another one, “Like a Flower,” going to Italian singer Laura Pausini (recorded in Italian under the title “Mi Abbandono A Te”).

Those songs followed a directive Madonna had given Nowels prior to their sessions as he was workshopping beats: “She said prepare stuff ‘either really radical or really beautiful…nothing in between.'"

You could apply both of those descriptors to one of Madonna’s Ray of Light tracks with Patrick Leonard, the Billboard Hot 100 No. 2 hit “Frozen.” Gossamer and gorgeous on the verses but inventive and CinemaScope-sized on the chorus, Leonard recalls Madonna’s specific instructions for that song: “She asked me if I could write something that was somewhere between The English Patient and Nine Inch Nails, and that's what ‘Frozen’ was.”

If the songwriting process on Ray of Light didn’t veer too far from her previous writing sessions, her choice in producers did make an enormous difference. After abandoning a plan to reteam with “Take a Bow” collaborator Babyface, Madonna turned to British techno veteran William Orbit -- whose Strange Cargo series she was a fan of -- to produce all but one of the album's 13 songs, and producer/composer Marius de Vries to co-produce three tracks.

"I knew it was extraordinary straightaway," says de Vries, who had previously worked with Madonna on Bedtime Stories and her Massive Attack collaboration "I Want You" (a Marvin Gaye cover). "William obviously has a very strong sound of his own, and it was coupled with her newfound confidence in both the songwriting and singing departments. Even from the early stages, I wouldn't say I knew it was going to be a groundbreaking commercial success, but I thought it sounded fascinating, compelling and creatively energized."

Orbit’s adventurous soundscapes and ambient textures gave the album a chilly cohesiveness. While Leonard did co-produce his four Ray of Light songs, he admits his presence was less involved than usual. “The other records we very much produced together, and on Ray of Light I was just watching a little bit,” he recalls. "It was pretty clear William was doing something very special and not something I would have done – it's not my wheelhouse. He works very uniquely. He has an impressive vision, for sure. At the end of the day, there wasn't anything I didn't like.”

Similarly, Nowels describes how Orbit used his demos with Madonna as “templates for his production,” noting that “‘The Power of Goodbye" was altered considerably. "Some of the chords changed and the feel of the song changed…. The demo got leaked online so you can hear the original. It was a No. 1 song in Europe. I love both versions, to me it is among her best songs.”

“I let William (Orbit) play mad professor,” Madonna told Spin for a 1998 cover story. “He comes from a very experimental, cutting-edge sort of place — he’s not a trained musician, and I’m used to working with classically trained musicians — but I knew that’s where I wanted to go, so I took a lot more risks.”

But for one of the biggest pop stars on the planet, the risk-taking stage can't last forever.

"They were in full-on experimental mode," de Vries says of joining Orbit and Madonna in Los Angeles to complete the album. "William, if left to his own devices, will keep generating ideas because he's first and foremost a profoundly creative soul. With the wealth of material they had they were maybe in need of a little perspective, and possibly I might say, discipline in the final stages." And it was an easy fit for him. "William and I come from the same generation and background, late '80s and '90s U.K. electronica. We already spoke the same language -- it wasn't a stretch for me to fit into that aesthetic, and it was easy for me to recognize that and protect it."

When de Vries hit the studio, two of his co-productions were already well underway. "'Nothing Really Matters' and 'Little Star' I had a really good head start on, I'd spent a couple weeks messing around with them in my studio near Cambridge.... finishing them off was relatively straightforward," he notes. And while he didn't co-produce it, he also contributed to one of the album's signature songs, helping push it over the finish line.

"('Frozen') wasn't finished and Guy (Oseary, Madonna's manager) in particular felt it was going to be a key track. Guy took me aside and said 'Look, there's a lot of cooks in this production kitchen already but it's not quite finished.' I took a day or two finessing and adding to some of the drum programming and making some additional textures for it. I love the song, and it turned out to be such a key track in making the album global, though perhaps at the time it didn't scream 'obvious hit' for me. But in the end I was just happy to contribute."

Leonard, who co-wrote and co-produced "Frozen," shared a similar sentiment when asked if he knew it would be a breakout. "When you're writing something, in my career, the word hit never comes into it. You just can't say that word. Bad word to say."

For de Vries, working on the driving "Skin" was "the most collaborative from the ground up" song on Ray of Light. The U.K. producer recalls adding a little Easter egg to that song via a field recording he'd taken in the Marrakesh marketplace Jamaa el Fna while on holiday with his kids: "If you listen very carefully to the tail of the fade on 'Skin,' you can hear my son -- who was maybe five at the time -- saying, 'Daddy are they snake charmers?'"

Kiddie cameos aside, Madonna didn't turn to Orbit and de Vries for their sweetness. Talking to Spin in 1998, she explained why she tapped the U.K. electronic producers for her seventh LP: “They bring the cold. I bring the warmth.”

Nowhere is that combination of daring production and vocal depth more apparent than on the title track (speaking of bold, the original version of “Ray of Light” exceeded 10 minutes until it was edited down.) A towering achievement in her discography and '90s music in general, “Ray of Light” helped introduce techno (already popular in Europe) to the top 40 in America, cracking the door open for an eventual electronic music revolution in U.S. pop.

But “Ray of Light” is more than just Madonna’s foray into electronica. As she told Spin, there’s a warmth she brings to the then-burgeoning genre -- few electronic albums prior to Ray of Light display moments of radiant joy along the lines of “Ray of Light.” It bursts with the ecstasy of a new day and new possibilities, conveying the sense of a fresh start that's still true to oneself. And a testament to her underrated talent as a songwriter, the lyrics on “Ray of Light” (partially based on the 1971 folk song “Sepheryn” from Curtiss Maldoon) are never cloying or pandering. What might have come across as Chicken Soup for the Raver’s Soul in the hands of a lesser talent becomes a transcendent, inspirational declaration of intent from the pen of Madonna Veronica Louise Ciccone.

“It’s an iconic album. It’s Madonna in all her artist glory. William had a revolutionary energy in his record making and I think they inspired each other,” Nowels says. “I feel personally honored to have had a small role in her musical story.”

"The whole album, not just the material I worked on, has an undeniable identity to it. You can play a second of it and you'd immediately know where you were and what album you're in," de Vries says. "That's probably one of the reasons for its longevity and position in people's favorite records list -- it's unmistakable. A huge tip of the cap to William Orbit, he should look back on this as a titanic achievement."

“(Madonna and I) collaborate together well and I've always held to the mutual respect we have for each other; we worked fast and easy,” Leonard recalls. “There was a couple things (on the album) I thought didn't get the kind of attention they should have, but right now, what I know about this process, if I listened to it right now, those things that I didn’t feel that way might be my favorite things. It’s too subjective and it changes with time.”

Ray of Light would hit No. 2 on the Billboard 200, moving 371,000 copies in its first week; it earned her four Grammys and went on to sell 3.89 million copies in the U.S. (through Feb. 15, 2018) according to Nielsen Music. Just days ahead of its 20th anniversary, its ongoing relevance to pop culture was underlined when Belgian figure skater Loena Hendrickx performed to “Frozen” at the 2018 Winter Olympics in PyeongChang. “It’s a powerful song,” Hendrickx told Billboard. “Madonna is someone I look up to because of her strong personality and the goals she accomplished. She is an awesome example of girl power.”

But beyond numbers and Olympic appearances, Ray of Light is a laudable rarity in pop music: It’s an album that demonstrates how true happiness starts with tough self-examination, and that the path to strength lies in acknowledging your regrets and weaknesses without letting them define you. Madonna would reach higher positions on the albums and singles chart after this, but never again would a dance-pop LP, from her or another, sound so wise.