Aftermath is an ability that damages anyone near in a one-tile AoE when the Pokémon is defeated.
If the user is defeated, it will explode, damaging every Pokemon in one tile AoE radius for 1/4 of their individual max HP. Aftermath will only damage other Pokemon if the map has no moral (has black map name). It is negated if there's a Pokemon with Damp on the floor other than the user (though Damp is negated by Aftermath user's Mold Breaker).
Pokémon With Aftermath Ability