In this answer, I will expand (greatly) upon those of @jaysmith and @bjornjoseph. Specifically,
- an alternate timeline is required to explain the inconsistencies between The Next Generation, Voyager, and Enterprise;
- an alternate timeline was in fact splintered off from the primary TNG timeline by events that occurred during the film First Contact.
The apparent inconsistencies
In the TNG episode "Q Who", Picard's Enterprise makes first contact (in 2366) with the Borg, as a result of an intervention by Q. The Enterprise crew show no recognition of the Borg whatsoever, and the computer does not make any kind of automatic identification of the Borg or their vessel (suggesting no such records exist). In this episode, it is revealed that Guinan's culture was decimated by the Borg. It is clear from her conversations with Picard in the episode that she has never discussed the Borg with Enterprise crew members on any prior occasion.
In "The Best of Both Worlds" (part 1), Fleet Admiral J.P. Hanson tells Picard that Starfleet has been preparing for a year for the eventual encounter with the Borg. He and Lt. Cmdr. Shelby both make statements that imply that the only information they have to work with are the sensor logs recorded by, and damage inflicted upon, the Enterprise during the "Q Who" encounter. This suggests that Starfleet has no data from any prior encounter with the Borg. This also suggests that neither Guinan nor any other El-Aurian refugee (e.g. Tolian Soran) living in Federation space had discussed the Borg with Starfleet or any official representatives of the Federation. (This is consistent with their reclusive nature.)
However, the first inconsistency with this appears in the Voyager episode "Dark Frontier" (part 1). Magnus Hansen, a Federation exobiologist and the father of Seven of Nine, says the following in a flashback:
MAGNUS: Field notes, U.S.S. Raven, Stardate 32611.4. It's about time. The Federation Council on Exobiology has given us final approval. Starfleet's still concerned about security issues but they've agreed not to stand in our way. We've said our goodbyes, and we're ready to start chasing our theories about the Borg.
Chronologically, he made these remarks in 2356, ten years before the events of "Q Who".
The next discrepancy occurs in the episode "Regeneration" of Enterprise. In 2153, human scientists at an arctic research station discover functional Borg drones who survived the destruction of the Borg sphere that went back in time to the 21st Century in First Contact. Captain Archer and his crew subsequently encounter the Borg in space. In particular, Dr. Phlox is exposed to Borg nanoprobes and almost becomes assimilated. He experiences brief periods of the Borg "hive mind". Surely, these experiences would be included in their logs and reports. Although the word "Borg" is not used, they do hear the catchphrase "resistance is futile", and they have enough data to make accurate records regarding the appearance of the Borg, about the assimilation process, and about the Borg's ability to adapt technology to fit their purposes (namely, their modifications to the simple transport ship that they used to escape Earth, which had a top speed of warp 1.4, which they increased to higher than warp 5).
Furthermore, they do research and find that Zephram Cochrane had made explicit reference to cybernetic creatures in a speech given in the 21st Century. His coworker, Lily Sloane, learned the term "Borg" for these creatures. (She remarked that it sounded "Swedish").
While the Bynar are an example of another cybernetic race known to Starfleet, the unique assimilation techniques of the Borg, their rapid adaptation, and their collective consciousness and hive nature would certainly mark them out in future encounters, e.g. in "Q Who".
Why these inconsistencies are not plot holes / continuity errors
The inconsistencies in "Dark Frontier" and "Regeneration" are not actually inconsistencies, but rather the result of a new timeline formed by the events of First Contact.
The formation of the new timeline happened like this:
When the Borg went back in time, they shifted their own "first contact" with humanity to the 21st Century. In the 22nd Century, they encounter Archer's Enterprise, and concrete data is collected for the first time regarding a species of advanced cybernetic organisms called the Borg (a named known to Lily Sloane and likely Zephram Cochrane) that can "assimilate" human beings and other species, and which function with a collective consciousness (all experienced firsthand by Phlox). In the 24th Century, Federation scientists Magnus and Erin Hansen follow up on this by requesting the use of the Raven and following the course plotted by the transport ship from the 21st Century (and also working on the suspicion that a subspace message was sent from that ship in the direction of the Delta Quadrant).
The existence of this timeline also has the following consequences:
The events of "Q Who" either did not occur in the new First Contact-induced timeline, or occurred differently. (For instance, if Q had still flung the Enterprise into the path of a distant Borg cube, the crew may not have had to rely purely on Guinan for knowledge regarding the Borg.)
The events of "Best of Both Worlds" may have been somewhat altered.
Finally, I want to emphasize that the existence of this splintered-off timeline is not supposition. For instance, the encounter with the Borg by the researchers in the arctic (and Archer's subsequent pursuit of the Borg) simply could not have happened in the pre-First Contact timeline. The events in the arctic were a direct consequence of the Borg Queen's decision to travel back in time. Therefore, we have the undeniable birth of a new timeline. The differences are minimal at first but become palpable as time moves on. For instance, Seven of Nine's existence as a Borg and her activities on the USS Voyager are features of the new timeline only, as a direct consequence of the Hansens' expedition.