When a Pokémon with this Ability is hit by a move that makes contact, the Pokémon with this Ability will steal the held item of the attacking Pokémon. It will not activate if the Pokémon with this Ability already has a held item. It will not activate if the Pokémon with this Ability is knocked out by that move.
If a Pokémon with this Ability is hit by a multi-strike move that makes contact (such as Fury Swipes), the item will not be stolen until after the final strike. If multiple Pokémon with this Ability are hit by the same move that made contact, Pickpocket will activate for the fastest one that does not already have an item.
Pickpocket activates after Magician and the Sticky Barb, and after Thief and Covet steal a held item. It also activates after the user consumes a single-use item due to the attack that hit it, such as a Focus Sash. Consequently, the Pokémon that has Pickpocket will always end up with the item. Pickpocket also activates after Knock Off, Bug Bite, and Pluck, meaning that the stolen item will not be lost, and if it does lose its item due to these moves it can immediately steal another.
Pickpocket activates after Magician and the Sticky Barb, and after Thief and Covet steal a held item. It also activates after the user consumes a single-use item due to the attack that hit it, such as a Focus Sash. Consequently, the Pokémon that has Pickpocket will always end up with the item. Pickpocket also activates after Knock Off, Bug Bite, and Pluck, meaning that the stolen item will not be lost, and if it does lose its item due to these moves it can immediately steal another.
The Life Orb and Shell Bell will activate before being stolen. The King's Rock and Razor Fang can still make the Pokémon with Pickpocket flinch even if stolen.
Documentation
https://bulbapedia.bulbagarden.net/wiki/Pickpocket_(Ability)
Relevant Code Points
More research needed.