This is how Wookieepedia apparently describes why Leia died.
“Rey’s search for Exegol took her to the wreckage of the second Death Star on the ocean moon of Kef Bir, where she engaged in a duel with Kylo Ren. During the fight, Organa sensed the confrontation and realized what she must do to save her son, Ben Solo. Prior to that moment, Leia had kept a secret: unknown to anyone but herself, Leia’s attempt to save herself from the vacuum of space during the attack on the Raddus had taken a heavy toll on her. In the intervening months, her health had continually deteriorated and she would constantly hear her brother’s urging to let go and be one with the Force, an action she consistently resisted as she did not wish to leave Rey nor the rest of the Resistance without first preparing them adequately. Upon sensing the confrontation, however, Organa knew that it was time.”
“Organa used the last of her strength to reach out with the Force and call out Kylo’s birth name to him. Upon calling for Ben through the Force, Organa collapsed and died, the last of her strength spent. The only witness to her death was R2-D2, who proved true loyalty to her at that moment, as he had also been present at her birth. Organa’s final act helped to redeem her son, who eventually sacrificed himself to resurrect Rey after the latter died in the process of smiting her malevolent grandfather at the battle of Exegol.”