History and specifics
In the early 2250s, King Geror of Yannid VI began negotiations to join the Federation, but the Klingon Empire backed rebel forces. The starship USS Republic responded to a request for assistance when Geror was killed and Prince Arlph was kidnapped, and James T. Kirk was among the landing party members that beamed down. Events led to a new king vowing that Yannid VI would never join the Federation.
Decades later, after that king died, Prince Storf renewed negotiations and eventually agreed to join the Federation. In 2273, the USS Enterprise orbited Yannid VI for shore leave and to pick up Ambassador Phral for the signing ceremony of his planet's admission to the Federation. Hikaru Sulu, Pavel Chekov and Marcella DiFalco visited a bar and sampled the beer before a brawl broke out, sparked by anti-Federation sentiment among some drunk natives. Phral attempted to destabilize relations and discredit Kirk, but after Phral's actions were exposed, Yannid VI officially joined the Federation. (TOS comic: "The Enterprise Murder Case!")