It differs depending on what source you get your information from, and none of the sources are true "canon" Here is their history according to the Star Trek: Destiny trilogy. This is a direct copy and paste from Memory Beta:
A species known as the Caeliar lived on the planet Erigol, having long ago harnessed claytronic atoms, programmable matter able to be controlled via a hive mentality. The Caeliar dedicated their lives to a Great Work, hoping to find the next evolutionary step for them. However, a deliberately malicious feedback pulse destabilized their Work and their solar system, forcing the evacuation of their cities. One of the cities, Mantilis was thrown through a subspace tunnel into the far past. The few Earth Starfleet officers who survived decided to make their living separate from the Caeliar, but were eventually forced to return. One Caeliar remained alive, Sedín, who merged with the three remaining humans, one of whom was Kiona Thayer who became the precursor to the first Borg Queen.