Pets are obtainable through many aspect of the games, like through crafting or through boss drops. Each different pet has its own special perks and comes with a little stat boost. Pets come in 6 rarities:
Some pets only have the Epic and Legendary rarity.
Additionally, only some pets can be upgraded to Mythic rarity through items.
Image taken by me, created by the Hypixel Team