Back in the Edo Period, families found themselves in a bit of a pickle whenever they birthed a child they could not take care of. The solution was often a form of belated family planning which involved killing or selling the babies. Parents then carved kokeshi to represent those children. They put the dolls in shrines in the home, to serve as memorials or grim reminders of what they'd done.
Today, kokeshi are sold as souvenirs, and the meaning of the word is generally forgotten. In fact, "kokeshi" is now more often used as a slang term for vibrator. And now that you know their history, that really is the nicest thing we can say about Miis.