"The SAR [secondary attack rate] in household contacts exposed to the delta variant was 25% (95% CI 18–33) for fully vaccinated individuals compared with 38% (24–53) in unvaccinated individuals. "
So the vaccine doesn't offer perfect protection, but enough to be statistically significant, even if exposed in a household. Also, because viral load declines faster in vaccinated people than in unvaccinated, they are contagious for a smaller window.
As to people not realizing that they could have a breakthrough infection, that's why we mask (and test, in settings like schools and health care facilities). None of the prevention methods is perfect, but taken together, they make a big difference.