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