In the past, much of the medicine that Americans took was in liquid form and tasted terrible. Young persons especially hated to take medicine. Today, this figure of speech means that a person who caused other persons difficulties finally has to experience the same kind of difficulty. ‘He got a taste of his own medicine’.