I believe that the mechanisms by which vaccines very occasionally cause harm are understood. But, I do not have suitable references to hand which can explain.
One example is that of live vaccines, where the vaccine is a living but attenuated virus that infects the vaccinated individual, but...