Not all vaccines are 100% effective, and not everyone is able to get a vaccine (such as immune suppressed or immune compromised).
Even if the vaccine is only partially effective, it will reduce the viral load and speed up recovery time, which is very effective at reducing the number of people that a vaccinated person can spread their illness to.
To prevent an outbreak, an infected person must spread their disease to an average of less than 1 person. Having more people vaccinated is the easiest way to reduce this number.
An immune suppressed person can still be protected by having a majority of people vaccinated, and therefore unlikely to spread a disease to a person who interacts with them.