Anabolic steroids are one category of PEDs. PED stands for performance enhancing drug, a broad term covering drugs used to improve abilities such as strength, endurance, or recovery.
Anabolic androgenic steroids are testosterone and related compounds that promote muscle growth and androgenic effects. Examples include testosterone, nandrolone, oxandrolone, and stanozolol.
Other PEDs work through different mechanisms. Examples include erythropoietin (EPO), which stimulates red blood cell production, and human growth hormone (HGH). Neither is an anabolic steroid. The US Anti-Doping Agency’s guide explains these different drug categories. USADA
The distinction describes the type of drug, rather than its safety. A substance being “nonsteroidal” does not automatically make it safer, and different PEDs carry different risks.