Philetairos was a relatively unknown actor who did a fairly good job playing the different diadochi against each other in order to establish a small kingdom of his own.
After the death of Alexander the Great, Philetairos started this game under Antigonos, who became the most powerful of the diadochi and was an excellent choice. However, when he noticed the forces arrayed against Antigonos to be a bit too much, he changed his answer to Lysimachos, who gave him Pergamon to manage.
Now Philetairos had a kingdom. He just needed an opportunity for independence. When Lysimachos executed his son Agathokles, Philetairos read the writing on the wall and defected to Seleukos, who had occupied much of Alexander‘s Asia. That allowed him to stay breathing, and when Seleukos was murdered by Ptolemy Keraunos, that gave Philetairos his opportunity.
Although he technically stayed part of the territory of Antiochos I Soter, Pergamon was effectively independent. Soon it grew strong enough that even Antiochos‘ full efforts couldn’t bring it back under his yoke, and he was killed in an attempt.
Interestingly, Philetairos himself was a eunuch, though we don’t know how that happened. For obvious reasons, he never married nor did he have children. He appointed Eumenes I to succeed him, which began the Attalid dynasty that lasted until Rome defeated Eumenes III in 129 BCE.