When Charles Dickens was a boy he was sent to work in a grotty old blacking factory to help pay off his father's debts. The work was long, hard, and utterly soul-destroying, and marked Dickens for life. However, he was able to turn this traumatic childhood experience into great art by using it as an inspiration for David Copperfield.
David, like young Dickens, is sent out to work. Child labor was depressingly common in those days, with few if any regulations to protect children at work. Like so many other children, David's forced to toil away in unspeakably bad conditions for nothing more than a pittance. What makes things even worse is that he's slaving away in Mr. Murdstone's wine warehouse. David already hated his wicked stepfather to begin with, and has even more reason to hate him now. He can't handle the appalling conditions, not to mention the humiliation of working for a man he so cordially loathes. So it doesn't come as much of a surprise when David runs away from the warehouse to seek sanctuary with Betsey Trotwood.