Borg history

Early History
The Borg were initially created on a nameless planet in the Delta Quadrant. The inhabitants of that planet had been struck down by a deadly disease that was slowly killing them. The scientists on the planet discovered a way to combat the disease with tiny nanoprobes which would enter a person's circulatory system and eradicate the disease. The nanoprobes worked but, had the unfortunate side-effect of turning the inhabitants of the planet into souless cyborgs, which soon began assimilating the world around them, with their nanoprobes. ("The Beginning", short story from Strange New Worlds VI).

Over the course of about a billion years, the Borg continued to enhance and improve, and became true cyborgs, removing all emotions and creating a collective consciousness that focused solely on turning the chaotic universe into structured whole. As the Borg began spreading across the Delta Quadrant, they encountered the powerful race later known as the Preservers. Despite being the more powerful race, they could not easily defeat the Borg collective consciousness. The Preservers soon disappeared, but created two prototype planet-killers that were robotic killing machines that were composed of neutronium and had the ability to stop the Borg. These devices were never tested by the Preservers, but both were later activated. (TNG novel: Vendetta).

After supposedly baninishing the Preservers, the Borg continued to expand and assimilate across the Delta Quadrant. Around 128,000 years ago, a large fleet of Borg ships attacked the Cetacean Probe in an attempt to assimilate it, the attempt failed, but they did succeed in damaging the probes crystal memory. Because of the failure of not assimilating the probe, the Borg back-tracked the probe's course to its home planet, and set out to assimilate the creators. Many millions were assimilated, but a large proportion was able to escape and their destroying their planets moon, and constructed an evacuation fleet in the debris of the moon. (TOS novel: Probe).

Around the same time, the Borg suffered one of their first major set-backs while attempting to assimilate the Trilex civilization. As a last resort to defeat the large Borg invasion force, the Trilex made their star supernova, which sent out a massive subspace pulse and destroyed the fleet. (TOS novel: The Return).

Despite these setbacks, the Borg continued to spread across the Delta Quadrant, and assimilating many of the native species including millions of Hirogen and their homeworld around 110,000 years ago. (novel: New Worlds, New Civilizations).

The 24th Century
In 2369, a Borg Cube ship attempted to travel from the Gamma Quadrant end of the Bajoran Wormhole into the Bajor system, but the vessel was torn to shreds by the wormhole as it was currently undergoing subspace compression. This would cause the collective to steer clear of the wormhole, thinking it dangerous (DS9 novel #2: The Siege).