Loess works by fitting multiple local regressions to subsets of the data. It does this by taking a weighted average of points within a specified window, or span. The weight decreases with distance from the target point, making closer points more influential in determining the smoothed value. This local approach allows the method to adapt to changes in the data, making it particularly useful for complex, non-linear relationships.