When a function takes two references and returns a reference, Rust needs to know which input the returned reference borrows from so it never outlives its source. A lifetime annotation like 'a simply connects the lifetimes of inputs and outputs.
ADVERTISEMENT