To undermine literally means to dig a hole underneath something, making it likely to collapse. But we more often use the word to describe sabotage or the act of weakening someone else's efforts.
Originally spelled with a ‘y’ instead of an ‘i’, undermine has Germanic roots and means "to weaken, hinder, or impair." Accidentally undermine the foundation of a house by digging a tunnel to China beneath it and you might be forgiven. Undermine your teacher’s authority by speaking out of turn and throwing spitballs and odds are you’ll get in trouble.