Categorical encoding is a process in data preprocessing where categorical variables are converted into numerical representations to be used in machine learning models. This transformation is crucial because many algorithms require numerical input and cannot directly handle categorical data.