Most often they're passed around where it's wet and people are walking barefoot such as at swimming pools and in gym showers. They are easier to treat when small and often do not go on their own. Salicylic acid treatments from the pharmacist can work if they're caught early.
Wearing flip-flops around the pool and in shared showers helps to prevent you catching them again.