Autocorrelation occurs when the independence assumption of error terms in regression models is violated, most commonly in time-series data, leading to dependence between observations. Visual inspections of residual plots and the Durbin-Watson statistic are used to detect autocorrelation, with specific thresholds indicating its presence. To correct for autocorrelation, techniques such as transforming the error term or using the Cochrane-Orcutt procedure can be applied to ensure compliance with ordinary least squares assumptions.