In the Book, Charlotte is a mother figure to Wilbur. She saved his life and died at the county fair. Three of her 514 children stay with Wilbur. She had sacrificed herself to save Wilbur. In "Miracles do happen", Charlotte returns in her apparition as a guiding light for Wilbur and Nellie.
In the Movies
Charlotte wanted to help Wilbur so she did. Charlotte was a true friend and saved Wilbur from being slaughtered. She died at the county fair. Three of her 514 children stayed with Wilbur. In "Miracles do happen", when Wilbur gives his life away for Nellie, Charlotte's spirit comes to take Wilbur away, and Nellie runs to her mother and hugs her while crying.