Martha Endell is barely a character at all. Even though she plays a pivotal role in the plot of David Copperfield, her character is a pretty generic representation of a lonely woman who falls into bad habits and must redeem herself in the eyes of society.
Like Emily, Martha is from Yarmouth; like Emily, her father was a fisherman; and also like Emily, Martha is an orphan. Dickens isn't exactly being subtle here: Martha is a double of Emily herself. In the chapters before Emily runs away, we get foreshadowing of Emily's fate in the shape of Martha, who follows Emily one evening like a "black shadow" (22.63). Both David and Steerforth witness this strange figure dogging Emily's footsteps on their fateful visit to Yarmouth.
Later in the same chapter, David finds Ham Peggotty waiting outside Mr. Barkis's house. Ham explains that he is waiting outside for Emily. Emily is speaking to Martha Endell, an old schoolfellow of hers who is only two or three years older than Emily herself. Martha has fallen into some unknown disaster – although it's probably sexual, since she is unmarried, and Ham is so disapproving of her morals. Even though Ham is not entirely comfortable with his virtuous fiancée spending time with the likes of Martha, he doesn't want to prevent Emily from doing someone a kindness.
Because Mr. Peggotty would not approve of his little Emily seeing Martha in his own home, Emily exchanges notes with Martha to arrange a meeting at Mr. Barkis's house. Ham accompanies her. Ham is impressed with Emily's generosity and sympathetic spirit, since Emily is so moved at the sight of pitiful, socially excluded Martha. Martha wants to move to London because, "No one knows [her] there. Everybody knows [her in Yarmouth]" (22.194). After loaning Martha some money and seeing her off, Emily becomes very upset. She asks everyone to help her become a better woman. Ham is totally confused by Emily's strength of feeling, but he does his best to comfort her.
It's clear that Emily sees her own future in Martha. That's why she's so insistent on helping the poor girl. That's also why, after Martha goes away with a bit of money in her hand, Emily is so distraught. Emily can see the consequences of sex outside of marriage in the society she lives in: it means total isolation and exclusion from one's family. And she's desperate to avoid such a fate, even though she can't seem to imagine just not running away with Steerforth.
After Emily runs away, David has an idea. Since he moved to London, he's been noticing this shadow on the streets occasionally – a shadow whom he thinks is Martha Endell. David suggests to Mr. Peggotty that one day, Emily may find her way back to London (which seems to be the place where fallen women go in Dickens's world). If Emily does wind up in London, Martha Endell may be best placed to find her. Mr. Peggotty reflects that there was a time when he thought Martha "a'most like the dirt underneath [his] Em'ly's feet" (46.124). But now, Mr. Peggotty has to rely on Martha to find his beloved niece.
David and Mr. Peggotty go out to the slums of London, trying to track down Martha Endell. They catch sight of her and follow her to an empty, decaying part of town. Martha is so far outside of society that even the neighborhood she lives in seems curiously without people. When David announces himself to Martha, she screams, but David catches her. Martha thinks that Mr. Peggotty must blame her for Emily's running away – as though sex outside of marriage is a disease that Martha could have passed to Emily. David and Mr. Peggotty both reassure her that she is not to blame, and that they have never thought so.
David and Mr. Peggotty ask Martha to help them find Emily. She wants to know if they truly trust her to inform them if she finds Emily. David and Mr. Peggotty assure her that they do. And it's this experience – of being trusted again – that redeems Martha morally. She is terribly sorry for what she has done wrong, and she absolutely swears to help Mr. Peggotty find Emily to make up for it. To show that Martha is on the up and up, she refuses any money for her help: she wants to assist the Peggottys for the pure virtue of it. By doing good, Martha begins to feel some hope for herself, even though until now, "nothing but harm has ever come of [her] deeds yet" (47.65).
Martha does eventually manage to lead David to Emily's lonely boarding house. By helping David and Mr. Peggotty find and rescue Emily from the life she had fallen into, Martha has redeemed herself according to the social values of the world of Dickens's novel. As a reward for her redemption, Mr. Peggotty offers to bring Martha with him to Australia. There, Martha meets and marries a decent guy who is aware of her past. It's kind of hilarious: in this book, Australia is like land of magic, with great new starts for everyone who sails there. We'd like to find a place like that!