The Earth's atmosphere acts like a lens and makes the sun, moon and stars generally appear slightly higher in the sky than they would in the absence of any atmosphere. This effect is largest at the horizon, when the path of light through the atmosphere is longest, and reduces as the body (sun, moon, star) climbs higher.
The effect means that the exact time of sunrise (etc.) is slightly earlier and sunset (etc.) slightly later.
TPE uses the refraction model by Sæmundsson in Chapter 16 of Meeus' Atmospheric Refraction, 2nd Ed. The magnitude of refraction depends on pressure and temperature also. TPE uses the US Standard Atmosphere Model to obtain values for pressure and temperature from the elevation above sea level of the primary pin location in order to adjust the default sea level refraction.
Remember, atmospheric refraction is not entirely predictable. Times of sunrise/sunset (etc.) can only be given to the nearest minute or so as a result. Local conditions may vary day-to-day resulting in observed sunrise/sunset not matching the predicted time exactly.
Meeus writes: "For heights of a few degrees the results of the formulae should be judged with care. Near the horizon the unpredictable disturbances of the atmosphere become rather important. According to investigations by Schaefer and Liller , the refraction at the horizon fluctuates by 0.3° around a mean value normally, and in some cases apparently much more. Remembering our chapter about accuracy, it should be mentioned here that giving rising or setting times of a celestial body more accurately than to the nearest minute makes no sense."