Lore is a villain from Star Trek: The Next Generation who physically resembles the android Data and is in fact a creation of the same creator and by human standards would be considered Data's twin brother - however unlike Data, who is normally a curious but harmless individual Lore is a clever, manipulative and cunning individual who believes solely in self-preservation - he is also shown to be a jealous type and basically has many traits that humans traditionally associate with hostility or even evil.
When Lore was introduced in "Datalore", he gave two contradicting versions of his history when Picard wonders aloud who was created first, Lore answers, "He was, but they found him to be imperfect, and I was made to replace him." and then when he and Data are talking he says that he lied and he was created before Data, but it was because he was made perfect on the first try, and the colonists became envious of him and told Soong to create another "less-perfect android".
Lore's real backstory was given only later in the episodes "Brothers" and "Inheritance." After several failures Dr. Soong was finally able to create a stable positronic matrix in Lore. However Lore was unstable emotionally and caused so much strife between the colonists that Soong had no choice but to deactivate him. After so many failures and the pain caused by Lore Juliana was opposed to Soong building any more androids, but Soong decided to build just one more android. He planned on repairing Lore after he and his wife Juliana built and tested Data, but before he could do that the colony was destroyed by the Crystalline Entity and Soong and his wife were forced to flee. Unknown to Soong, his wife, or the colonists at the time, it was Lore himself who had contacted and attracted the Crystalline Entity to the colony to destroy it. Data meanwhile had been left outside with no memories or any idea of who he was.
In 2364 Lore's remains were discovered in Soong's lab in the episode "Datalore." Lore was rebuilt and reactivated. Although Lore initially appeared as inquisitive and harmless as Data, his true nature was gradually revealed during the episode. Lore secretly contacts the Crystalline Entity again, offering it the crew of the USS Enterprise as sustenance. However, Data foils his plans and transports Lore into space before the Crystalline Entity can attack, saving the ship.
In the episode "Brothers", Soong summoned Data to Terlina III in order to give him an emotion chip. However, the same signal summoned Lore, who had been found drifting in space and rescued by a group of Pakleds. Data tried to keep Soong from reactivating Lore, but Soong ignored Data's warnings and reactivated Lore. In the reunion that followed Soong set Data straight, that he was not inferior to Lore in any way - that the two men were identical in every way except for a small bit of programming.
When Soong revealed that he was dying and had summoned Data to give him a chip containing basic emotions, Lore incapacitated Data and posed as him while Soong installed the chip. He then fatally wounded Soong before fleeing.
In "Descent, Part II", Lore revealed that he later encountered a group of Borg struggling with individuality following the Enterprise crew's actions in "I, Borg", and became their leader. Lore uses Soong's emotion chip to control Data until Geordi La Forge, Jean-Luc Picard and Deanna Troi manage to reactivate Data's ethical programming. Data shoots Lore at the end of the episode and then deactivates him permanently. As he is being deactivated Lore's final words to Data are "I love you... brother." and Data replies, "Goodbye, Lore."
Data then had the Enterprise engineering department dismantle Lore, retrieving his emotion chip in the process. After Lore was dismantled Data put Lore's brain in a secure vault on the Enterprise-D that was designed to self destruct if it was tampered with. The rest of Lore's body was alsokept separately in the lab. When the Enterprise-D crash landed on Veridian III the vault was damaged and the self destruct feature activated, destroying Lore's brain in the process. The remainder of Lore's body parts were unharmed, and Data brought them along when he was assigned to the Enterprise-E.