Have you ever noticed how off in her own little world Luna appears to be most of the time, but then she’ll suddenly have a “lucid” moment, where you realize she really is just as sane as everyone else? People tend to overlook the fact that she’s in Ravenclaw because of her spacy behavior, forgetting that she’s actually quite intelligent, as well as uncannily insightful when it comes to the behaviors and motivations of those around her. “Wit beyond measure is man’s greatest treasure!” is a well-known saying of Rowena Ravenclaw’s, and Luna embodies it perfectly.
Many fan fiction authors have written scenes into their stories where Luna confides to her closest friends (usually Harry and Hermione, sometimes Neville or Ginny) that a lot of the creatures she talks about are purely her own creation, made up as a way to distance herself from everyone else to keep others from getting too close to her. Having been devastated by the loss of her mother, she’s been reluctant to let anyone else become close to her, not wanting to suffer that kind of loss again. Every once in a while one of her supposedly made-up creatures turns out to be real, such as the Crumple-Horned Snorkack, if extremely rare (or sometimes extinct). In a couple different stories, the Snorkack was a cat-like creature similar to a kneazle, with the addition of the crumpled horn on its forehead similar to that of a rhinoceros horn. In one of those stories, it could also grow to enormous size when defending Luna and her friends, and attacked and killed a group of Death Eaters attempting to harm Luna.
Luna is fiercely loyal to her friends, and is easily as powerful as Harry and Hermione, with the added benefit of knowing almost as many spells (Ravenclaw, remember). She was one of the few members of the DA who went with Harry and Hermione to the Ministry in an attempt to rescue Sirius (not realizing, of course, that he was in no actual danger at the time) and participated in the Battle of the Department of Mysteries, holding her own against the Death Eaters, fighting by Harry’s side as much as possible until he chased Bellatrix Lestrange all the way back to the Atrium, trying to avenge Sirius’ death at her hands. Luna also fought in the Battle of Hogwarts, and distracted those in the immediate vicinity in the Great Hall so Harry could slip out unnoticed to search for Ravenclaw’s diadem.
When Harry, Ron and Hermione went to see Luna’s father during their Horcrux hunt to ask him about the pendant he wore at Bill and Fleur’s wedding (which turned out to be the Deathly Hallows symbol), Harry looked into Luna’s room and saw the pictures she’d painted on the walls of the three of them and Neville, with the word “friends” in a continuous chain connecting the pictures. Up until that point, Harry hadn’t realized how important they all were to Luna, and after rescuing her from Malfoy Manor, he became a much better friend to her, even partially naming his and Ginny’s daughter after her (Lily Luna).
Luna was one of the mildest-tempered students at Hogwarts, not seeming to mind the awful nickname she’d been given by her classmates (“Loony”) or the fact that her housemates were constantly stealing her belongings and hiding them from her, patiently posting notices at the end of every year asking for their return so that she could finish packing. Harry was outraged on her behalf when he heard about this, and even offered to help her get her things back, but she serenely replied that everything was returned to her eventually every year, but that she really needed to finish packing so she hoped her things would be returned soon. Harry marveled at her capacity for forgiveness, knowing his reaction would be much different if the same thing were to happen to him. What would seem like simple naivety to others was simply Luna’s undying faith in humankind, instilled in her by her mother, and her open-mindedness and capacity for believing the impossible, instilled in her by her father.