Thomas Riker was created on the planet Nervala Four during an attempt to beam up William Riker in the narrow window that the planet's conditions allowed for transport. The transporter operator attempted to obtain a second transporter lock on Riker to ensure his safe retrieval, and the second transporter beam reflected back onto the planet, where "Thomas" Riker re-materialized. Thomas lived there for years, assuming that his shipmates thought him dead. He was rescued by the USS Enterprise, ironically by William Riker.
Unable to stomach serving on the same ship as his transporter double, he sought a position elsewhere in the Federation fleet.
Joining the Maquis
Disillusioned by his life in his own shadow, Thomas Riker eventually left Starfleet and joined the Maquis. As an exact duplicate of William Riker, his biometrics allowed him to penetrate the security around the USS Defiant at DS9. Once on board, he kidnapped Kira Nerys and faked a catastrophic system malfunction to steal the ship and take it into the Cardassian DMZ to attack a secret Obsidian Order shipyard. He was tracked down and captured by Gul Dukat and Benjamin Sisko, after which he was sent to a Cardassian prison, where he presumably died during the Dominion War.
Lieutenant William Riker was promoted for exceptional valor during the evacuation of Nervala Four. "Thomas" Riker, who performed exactly the same actions, did not receive such a promotion when he was discovered and rescued. This apparent prejudice against him may have influenced his decision to leave Starfleet.
Because of the nature of his creation, there is no sure way to say which Riker is the "original" version, William or Thomas. This raises many questions about the ethics of intentionally using the transporter in this fashion. How many times can a transporter pattern be duplicated before the copy is considered a different person? What real rights does the original Riker, whoever it really is, have over the double?
These ethical concerns may explain why the Federation, which has already shown signs of prejudice against clones, never tried to replicate this event.