Trick switches held items with the target. It does not require both Pokémon to be holding an item, in which case the item is simply given to the target or received from it. Switching items with wild Pokémon is permanent (received items are kept, given items are lost). All held items in Trainer battles and wi-fi/linked battles (including Battle Tower/Subway/Maison) are returned to their respective owners at the end of a battle. Pokemon with the ability Sticky Hold cannot have their held item removed. The Griseous Orb cannot be removed from Giratina; Type Plates cannot be removed from Arceus; Drives cannot be removed from Genesect; and Mega Stones cannot be removed from their respective Pokémon.
In Generations 3-4, switching items with a Trainer’s Pokémon is also permanent, but Trick will fail if used by a wild Pokémon or a Trainer’s Pokémon.