Actually that isn't quite correct. No vaccine is 100% effective. That means, in a population of a couple hundred vaccinated people, a couple will not have full immunization. So what we depend on is what's called "herd immunity", which is essentially immunizing as many people as possible so as to stop the spread of a disease before it has the chance to reach one of the susceptable.
Look at it this way. 100 people are in an enclosed room with only one entrance. They have all been vaccinated against disease X. However, there are a couple people scattered in the group who don't have immunity. Now, suppose someone from outside the room carrying diesase X comes up to the doorway and has contact with the person standing there. Chances are very good that the person in the doorway will be immune to the diesase and, therefore, can't pass it on to the ones who are not immune. They have indirectly been protected from disease X.
This isn't a perfect analogy, but it shows why it is important to immunize as many people as possibly, and why diseases reemerge when immunization rates fall.