The oral polio vaccine is a live attenuated vaccine, meaning it contains live virus passaged through cells or another organism so that it is no longer pathogenic to humans. When an individual receives this vaccine, some of the attenuated virus is passed in the feces.
My understanding is that it is then very easy for an unvaccinated individual to come into contact with this fecal contamination and become immunized. Say for example an entire family shares the same bathroom but only one was vaccinated, the whole family would likely become vaccinated indirectly.