Armor piercing makes an attack do damage according to the amount of armor minus the armor piercing.
Namely, if an attack does 5000 damage with 1000 armor piercing against a 4000 armor target, it'll do damage as if it were 5000 damage against a 3000 armor target, making it do 2000 damage.
Armor piercing, however, can not reduce armor below 0, so if you have 999,999 armor piercing against 100,000 armor, you'll just do damage as if the armor were 0.