The data is transformed into a state-space model, and the values are replaced using the Kalman filter.
The idea behind the state space representation, is to cast a time series as a set of inputs, states and outputs that evolve through time. The Kalman filter is an algorithm that allows us to operationally work with these models.
A good introduction to the Kalman filter can be found on https://www.google.com/search?q=klaman+filter&rlz=1C1GCEA_enGB822GB822&oq=klaman+filter&aqs=chrome..69i57j0l5.94505j0j7&sourceid=chrome&ie=UTF-8.