The Tale of Two Bad Mice was published by Frederick Warne & Co. in September 1904. Like many stories, it had stimuli in everyday life. Potter’s editor, Norman Warne, was making a dolls house for his niece Winifred, and Potter’s cousin had trapped two mice.
The story is sometimes read as a reflection of Beatrix Potter’s frustration with the restricted life of a victorian lady in her parent’s home. If so, we may hear what Wikipedia calls “themes of rebellion, insurrection, and individualism”. (16/5/14) Certainly the animal characters in Beatrix Potter’s books do “act like people”, and seem to suggest such interpretations, however since the details of these vary from person to person it may rather be part of the genius of her writing that different people can identify differently with the story.
Whatever the psychoanalytically minded may conclude about the story, while it was in production Potter and Warne fell in love and became engaged.