Some questions compare a row with the one before or after it, like the change in sales from last month. LAG reads a value from an earlier row and LEAD from a later row, in the order you choose. Use them for differences between consecutive rows, gaps between dates or streaks. Before window functions this needed a self join, which is harder to read and easy to get wrong.