What is the difference between em and rem units?

em is relative to the font size of its nearest parent, while rem is relative to the root (html) font size.