How does the CSS box model work?

The box model describes how an element is rendered with content, padding, border, and margin around it.