Pus is simply a mixture of water, protein (inflammatory exudate) and white blood cells. Often pus is seen in association with infections because there is a large inflammatory reaction which occurs in the presence of invading bacteria, but an infection doesn't have to be present. There are certain inflammatory skin conditions like pyoderma gangrenosum which have a lot of purulence (pus) associated with them, but they aren't infected.

Additionally, if someone has a deep abscess (i.e. collection of pus) and they have been on antibiotics, the bacteria may die, but the pus will remain. This is another example of sterile pus.