From Bulbapedia, the community-driven Pokémon encyclopedia.
Same-type attack bonus, commonly abbreviated as STAB, is a 50% boost to the power of an attack when the attack is the same type as one of the types of the Pokémon using the attack. This results in a 50% increase in damage (100% if the Pokémon has the Adaptability Ability.)
Same-type attack bonus does not apply to moves that do a set amount of damage nor ones that do not use the normal damage formula, such as Dragon Rage and Seismic Toss.
The same-type attack bonus was introduced in Generation I and has remained unchanged since.
Example of attack bonus
A Blastoise using Surf increases the power of the move by 50%, from 95 to 142, since both Blastoise and Surf are Water-type. However, a Blastoise using Ice Beam does not receive an increase in special attack power of the move, since Blastoise is not an Ice-type Pokémon.
A Lapras, on the other hand, would receive the same-type attack bonus when using either Surf or Ice Beam, since Lapras is both Water-type and Ice-type.
Due to the same-type attack bonus's relatively undocumented status, several misconceptions have arisen about its applicability.
Normal and Dual Type Pokémon
Contrary to some of Nintendo's official guides, Normal-type Pokémon do in fact receive the same-type attack bonus when using Normal-type attacks, and same-type attack bonus is not reduced for a dual type Pokémon.
Hidden Power does receive same-type attack bonus, if the Pokémon's actual Hidden Power is the same type as the Pokémon. For example, a Fire-type Pokémon will receive same-type attack bonus when using a Fire-type Hidden Power. Although Hidden Power is displayed as Normal-type in the game's data, a Normal-type Hidden Power is not obtainable. Because of this, Normal-type Pokémon will never receive same-type attack bonus when using Hidden Power, unless they are dual-types, use Camouflage, or have either Normalize or Color Change as their Ability.