The 'em' and 'rem' units are both relative length units in CSS, but they work a bit differently. The 'em' unit is relative to the font size of its closest parent element, while the 'rem' unit is only relative to the root (or html) element. This means that 'em' can change depending on its context, but 'rem' will always be the same throughout the entire document.