The reasons why seemingly random experiences are preserved in our memory, and how this could hold the keys to our future.