The peak-end rule describes how people evaluate a past experience in memory: not by its total duration or its average intensity moment-to-moment, but almost entirely by how it felt at its most intense point and at its very end. This means two experiences with identical total suffering can be remembered completely differently depending purely on how they concluded — and, more strikingly, that a longer version of an unpleasant experience can be preferred in memory over a shorter one, if the longer version ends on a slightly better note.
Kahneman frames this as evidence for two genuinely separate systems inside a person: the "experiencing self," who lives through events moment by moment, and the "remembering self," who evaluates and stores the memory afterward — and it's the remembering self, using this distorted peak-end shortcut, that actually makes future decisions about whether to repeat an experience.