To Selene, Necrozma was her dearest friend, her most trusted companion, her greatest strength. It had not always been that way - when she first met the beast, it was her enemy, a terrifying presence that tore through space itself to sate its unending hunger. It had consumed Nebby, forcibly merging with her close friend and dragging it off to Ultra Space.
The battle with Ultra Necrozma had only been won through persistence and the deep bond Selene had with her team. When it fell, she was surprised; she hadn't expected to actually defeat the creature, godlike as it was, and she all but collapsed in relief when Nebby appeared before her and restored the light Alola had lost. Elated by her victory, Selene did not even think about Necrozma anymore until she encountered it again on Mount Lanakila.
It laid in a crater, hunched over, looking as though it struggled to support itself. Reduced to its incomplete form, it didn't look anything like the blinding dragon she'd fought in Ultra Megalopolis; she recalled what the Ultra Recon Squad had told her, and offered the great prism some of the light from her Z-Power Ring, and that restored far more of its strength than she ever anticipated - it challenged her to a battle immediately afterward, though it seemed more as though it wanted her to capture it.
And so she did. With Necrozma at her side - fused with Nebby, although voluntarily this time - Selene became the greatest trainer in all Alola, ascending to the peak of Mount Lanakila and sweeping through the Elite Four. Though her struggle for the champion's title left Necrozma at the back of her team, only to be used as a last resort, she still thanked her new companion for its contribution.
After all, if it hadn't been for Necrozma's strength, Selene would never have reached the heights she had... and she would never have been able to understand the truth behind her journey, the meaning behind the Z-Crystals and their otherworldly power.
Necrozma needed her light, and she was more than willing to give it in exchange for all it did to help her.
To Necrozma, Selene was its savior, the brave human who had freed it from madness and restored its lost light. When the two first met, they were enemies; Necrozma, blinded by its pain and anger, lashed out at the one who tried to separate it from its newfound source of energy. She battled fiercely, the will of her companions far stronger than Necrozma had anticipated - but at the time, it had lost its mind, unable to appreciate that unique and enduring power.
At the summit of Megalo Tower, Necrozma sought to battle that infuriating human again. When she came, its madness reached a new height, and it tore into her partners with reckless abandon; the full extent of its blinding might was laid out for her to see, and yet she persevered, unwilling to back down even in the face of what seemed like certain defeat. At last, Selene emerged victorious - and Necrozma, having exhausted the last of its strength, fled to her world in an effort to recuperate.
It was an unsuccessful attempt. Without Solgaleo's light, Necrozma knew that its end was near; its hunger had finally consumed it after all those years of emptiness, leaving it wasting away on a frozen mountain, alone in the darkness - and it hated humans more than ever then, its brief moment of lucidity allowing its grudge to boil over, even if it was powerless to act on those feelings.
Yet, that human who had defeated it twice showed it compassion - showed it a fraction of the light it had once lost. With some of its original power returned, Necrozma understood that Selene wanted to help it, and it decided to test her for one last time. The battle was short, and she claimed it as her companion with relative ease, holding it within an ornate capsule that brought it a most peculiar comfort.
This time, Solgaleo relented to Necrozma's control and willingly gave its light. The feeling was indescribable, even to a creature as ancient as Necrozma; not only had it recovered from the verge of death, the hunger that it had struggled with for so very long was satisfied at last, the radiance of Solgaleo combining with the power of those crystalline shards Selene carried in a way that, for the first time in eons, made Necrozma feel truly whole. At last, it was able to forget the pain inflicted upon it by humans, and allowed itself to place its trust in one... for the time being.
That trust grew faster than Necrozma had thought it would. Selene turned out to be a fantastic trainer, always eager to show off her new companion; it dutifully followed her commands, its radiance guiding her to victory against otherwise insurmountable foes, and its respect for her became stronger with each of those battles. The willpower which had defeated Necrozma thrice now became part of its own strength, adding to the light that Selene had already given it, and it embraced that unique blessing - a blessing given to it by a human of all things, as though she wanted to be the equal of a creature that had once ruled over all of Ultra Space.
And, in Necrozma's still somewhat damaged mind, it decided that if Selene wanted to be its equal, it would make her just that. She had already taught it so much - compassion, empathy, things it had forgotten in its ages of suffering - and so she deserved its own blessing, that of the unfathomable light which shone upon all of existence.