Pneumococcal vaccines work by stimulating the immune system to produce antibodies against Streptococcus pneumoniae. This helps to prevent the bacteria from causing infections in the future. PCV13 protects against 13 types of pneumococcal bacteria, while PPSV23 covers 23 types.