I’ve seen a lot of people wonder why Elsa didn’t eventually tell Anna about her powers and explain why she didn’t want to be around her. I do agree. Things probably wouldn’t have gotten as complicated if Elsa had spoken up. However, I have a(n in-universe) theory on why she didn’t.
First off, the trolls erased Anna’s memories, believing it would further help keep both sisters safe. If Elsa tried to tell Anna what happened, she would’ve had difficulty making Anna understand because Anna had no recollection of Elsa’s powers and thus, the incident that led to Elsa’s paranoia.
Support: When Elsa does reveal does her magic, Anna only knows half of the problem. She only knows that Elsa has powers, not that those same powers almost critically injured her thirteen years ago. She doesn’t know it’s a specific incident that led to Elsa’s withdrawal, not the mere fact that Elsa has powers.
Also, it was Elsa’s parents’ choice to separate the sisters, not Elsa’s. Elsa was eight years old. She could’ve been convinced that this one incident didn’t have to lead to total isolation from her sister, but her parents thought otherwise. By the time Elsa was old enough to finally speak up about it, she may not ever have considered it because it’d already been a secret for so long. We also don’t know if Anna ever tried again after that attempt when their parents died. For all we know, it could’ve been the last time Anna knocked and if she had finally given up, it may have been more reason in Elsa’s mind to keep quiet. If Anna’s not knocking anymore, what’s the point?
In short, I think it was just a combination of the memory erasure, her parents’ decision, and time passing that made Elsa overlook the idea of ever telling Anna about her powers.
While it wasn’t the wisest decision, it’s not a strange one. People keep important secrets from each other in real life all the time for a variety of reasons. Heck, my birth was kept a secret for some time! Eh, that’s life.