The shows give very little information on the Borg's origins.
Memory Alpha has this:
The origin of the Borg is vague. What is known is by hearsay or brief
contacts with Borg survivors or even the Borg itself.
According to the Borg Queen, the species known as the Borg started out
as normal lifeforms without any cybernetic enhancements thousands of
centuries ago. Over the years, they evolved into a mixture of organic
and artificial life. (Star Trek: First Contact; TNG: "Q Who") It is
believed that the Borg originated in the Delta Quadrant, where they
already existed in 1484. At that time, only a handful of star systems
had been assimilated by them and they had many encounters with a
species who called themselves the Vaadwaur. (VOY: "Dragon's Teeth")
There is more information from the novels as to their origins, but a lot of it is contradictory and it is not considered canon.
Go check out the Memory Beta page on the non-canon origins of he Borg.