It means deliberately trying to make someone or an idea look bad or at least less than it is or they are. For instance if someone said that you were a terrific person and someone else said " not so much when you get to know them", that would be an example of undermining.