The transphasic torpedo was a Starfleet weapon developed sometime in the 2380s in a future alternate timeline. It was designed specifically to handle the Borg threat, with input by Captain Kathryn Janeway and the crew of the USS Voyager.
In 2378, the point to which Admiral Janeway from the alternate timeline had traveled back in time, the admiral introduced Captain Janeway to this technology for use in reaching a Borg transwarp hub accessing the Borg transwarp network to return to Earth. When entering the nebula where the transwarp hub was located, one transphasic torpedo was enough to destroy a Borg cube. Despite the use of transphasic torpedoes to destroy two cubes, the Collective had not yet adapted to the torpedoes when Voyager fired at the interspatial manifolds in the transwarp network. (VOY: "Endgame")
According to the Pocket Books novel Greater than the Sum, transphasic torpedoes were in fact kept by Starfleet as the weapon of last resort to be deployed to starships only when all else had failed against the Borg. They were the one and only thing Starfleet knew the Borg had not yet adapted to and for that reason wanted to keep this ace in the hole for as long as possible.
The warhead technology of the torpedoes was also revealed in the novel. It is based on generating a destructive subspace compression pulse. Upon detonation the torpedo delivers the pulse in an asymmetric superposition of multiple phase states. Shields can only block one subcomponent of the pulse. The other subcomponents deliver the majority of the pulse to the target. Every torpedo has a different transphasic configuration, generated randomly by a dissonant feedback effect to prevent the Borg from predicting the configuration of the phase states.