This proverb warns you against eliminating something good when trying to get rid of something bad. For example, before you send that old desk to the junkyard, check the drawers to see if there’s anything of value still in them.
The proverb has been in use in English since the late 1800s, but it originated in the 1500s as a German proverb. Wolfgang Mieder published a comprehensive study of its origins in 1992. He claimed the first known printed example to be in a satire of 1512 by Thomas Murner with the title Narrenbeschwörung (Appeal to Fools).
The Scottish philosopher Thomas Carlyle, who was also a German scholar, translated the phrase in an essay denouncing slavery entitled Occasional Discourse on the Nigger Question (1853).
Carlyle disagreed with the establishment view on slavery that was held in his day, but he was not exactly what we would call a freedom fighter. He compared the dirty bathwater to slavery (which should be discarded) and the baby to the useful service provided by the slaves (which should be kept). He suggested that blacks were born to be servants and were useful only in that role. His basic proposal was that blacks should be hired for life as servants and given payment, not kept as slaves.
George Bernard Shaw used the proverb many times in his work. The first was in the introduction to his play Getting Married in 19ll.
The silly email that circulates the Internet as “Life in the 1500s” claims that in medieval times people shared bathwater and by the time that the baby was bathed the water was so murky that the baby was in danger of being thrown out unseen.
That is utterly ridiculous, of course, as any mother could tell you.