Quick question

Im all for vaccinating but if vaccines help protect against diseases how come people without vaccines cant be around people that are vaccinated if they are protected ? Someone educate me lol