We judge an experience largely based on how we felt at its peak (most intense point) and at its end, rather than the total sum or average of every moment.
A painful medical procedure is remembered as less painful if it ends with a period of mild discomfort rather than stopping abruptly at high pain.
Cognitive
Peak-End Rule
End on a high note