In HTML, the background color code controls the webpage's background hue. This can be achieved using various formats: named colors (like 'red'), HEX codes (like '#FF0000'), or RGB values (such as 'rgb(255,0,0)'). To set it, use the CSS property `background-color` within a style tag or inline styles for precise design.