During the mid-24th century, a group of Bandi captured an injured space vessel lifeform and brought it to the surface of Deneb IV. The Bandi nourished the lifeform back to health, but kept it only strong enough to use its unique ability to change energy into matter. Too weak to leave the surface, the creature was imprisoned on the planet and forced to manifest itself as Farpoint Station. They then proposed an alliance to the Federation, offering them the use of Farpoint Station as a starbase.
In the year 2364, the lifeform's mate came to Deneb IV to free it, attacking the nearby "Old Bandi City". This attack led the crew of the USS Enterprise-D to realize the nature of Farpoint Station and give aid to the injured creature, allowing it to rejoin its mate in orbit of Deneb IV.
According to Star Trek: The Next Generation Companion (p. 24), in an initial story outline that D.C. Fontana wrote for "Encounter at Farpoint", the conceptual progenitors of the Bandi race were simians collectively known as the Annoi. They were more hostile to the Enterprise-D crew than the Bandi are in the episode and, in later drafts, they were collectively renamed the Annae.
The second Star Trek pilot, "Where No Man Has Gone Before", establishes that telepathic communication was in use amongst Deneb IV natives. However, this is not evident in the TNG episode. Star Trek: Star Charts (pp. 34, 41 & 44) explains there were two Deneb IVs: Deneb Kaitos IV, with the telepathic natives, and Alpha Cygni IV, also known as Deneb IV, the planet of the Bandi.