Both IPV and OPV stimulate the immune system to produce antibodies against the poliovirus, providing immunity. IPV induces immunity in the blood, preventing the virus from reaching the central nervous system. OPV, on the other hand, induces immunity in the gut, which is the primary site of poliovirus replication, thereby preventing virus shedding and transmission.