If used from the Bag, it changes a Pokémon's Ability from one of its standard Abilities to its other standard Ability. It is consumed after use.
The Ability Capsule can only be used on a Pokémon that belongs to a species that has two standard Abilities. For example, it can be used to change a Pidgey's Ability from Keen Eye to Tangled Feet (or vice versa), but it cannot be used on a Pikachu (whose standard Ability is always Static). It also cannot be used to change a Pokémon to or from its species's Hidden Ability. The Ability Capsule also cannot change a Zygarde's Ability from Aura Break to Power Construct (or vice versa).
The Ability change is retained even if the Pokémon evolves, and the Ability slot provided by the Ability Capsule is maintained if the evolved form has a different standard Ability. For example, a Lillipup which has Pickup evolves into a Herdier with Sand Rush, but if Lillipup's Ability is changed to Vital Spirit with the Ability Capsule it will have Intimidate after evolution.