Pets are summoned servants that fight for their masters. There are 3 "pet classes:" Magician, Beastlord, Necromancer. These 3 classes have the most control of their pets while also receiving the most benefit. They also are the only classes that can utilize items containing pet focus effects.
The Magician is the premier pet class, having 5 separate pet types to summon - each having unique strengths with minimum trade-offs. There are 4 elemental/construct types of pets (water, earth, air, fire) and one "monster" pet that assumes a random NPC graphic of the zone. This ensures magician pets have the most versatility, defensive & offensive characteristics of any other pet in the game. The magician being the master summoner also enjoys a monolopy on summoning armor & weapons purely for pets to use, and they also have a multitude of unique pet-only utilities. Eventually the magician also gains the ability to summon very short duration, very powerful pets that can be utilized in addition to their normal pet. Through their entire career, magician pets compose a large percentage of the magician total DPS and defensive capabilities and are centric to the class. Having a large percentage of DPS being performed by a pet (melee) also reduces the class penalty suffered from highly magic resistant (or immune) targets.
Beastlords summon warder pets which are various animals depending on the race of the beastlord. Their pets have unique offensive characteristics via the beastlord ability to imbue their pets with a multitude of different warder-only proc effects. The beastlord relies on it's powerful innate abilities (slow, haste, buffs, heals) to further compliment their pet abilities.
Necromancer pets are undead minions, and the weakest of the pet-class group both in offensive and defensive capabilities. The necro is unique in gaining an Alternate Ability to command their pet to feign death. Though the necromancer pet initially provides a substantial part of the entire class power package, eventually the pet composes only a small percentage of the total DPS the necromancer is capabable of delivering. This results in the benefit of not relying on a unreliable & fragile pet as a major contributer of DPS, but limits the necro contributions against highly magic resistant (or immune) targets.
Other classes can have pets, but their ability to control the pet is severely limited, and the pets are significantly weaker in offensive & defensive abilities...and generally lower in level compared to a pet-class pet summoned from the same level of spell. The level of a pet directly impacts how well it performs against foes via offensive & defensive skills.
Additionally, a charmed NPC controlled by a player is referred to as a pet - and is used in the same fashion.
View the respective class links & fansites for more detailed information on pets.