The 'var()' function in CSS is used to retrieve the value of a custom property, allowing for the reuse of values throughout a document and enabling easier maintenance and theming. It supports fallback values, ensuring robustness in cases where a custom property is not defined.