I think with the invention of nano-probes, someone in the delta quadrant could not contain them and began turning people into cyborgs. This is just me, however, I think the Borg came about when a Nano Project went FUBAR. As the Nano-Probes assimilated/ transformed the people they took, the becan to link up cybernetically, mentaly. Over time, the nanites becan interrupting brain functions, making them think all as One. They becan to get technology as the nano-probes began establishing fully.
When thet traveled in space and found new species, they assimlated them and their technology and began building on from what they has tarted with. More and More species were assimilated and new technologies were mixed in with their own. This is what makes the borg more powerful and dangerouse. However, this is just my theory.