In a nutshell
On its own, attention treats a sentence as an unordered bag of words. A positional encoding fixes that by adding a unique signature to each position, built from sine and cosine waves of different speeds. Because nearby positions get similar signatures, the model can also read how far apart two words are.