When Sheila died, all Bonnie had was her magic. She didn’t have her dad because he didn’t want to hear all facets of her grief (the supernatural part). She couldn’t tell Caroline everything. Elena was in the middle of it in a way that wasn’t beneficial to Bonnie. All she had was her magic! She practiced it and worked on it and got better at it.
It’s the one thing that can’t can’t disappoint her, and I do read Bonnie as realizing this on a subconscious level (Bonnie’s subconscious, not mine). Her mom will abandon her; her dad will ignore her; her best friend will choose others over her; her boyfriend will cheat on her; people will disappoint her and fail her. But hermagic is the one thing Bonnie has complete control over. Whether it works or fails is completely dependent on Bonnie herself.
Read more on my favorite Bonnie relationship
here!