Barash's planet had been invaded by an unknown foe. His mother hid him on Alpha Onias III, where she hoped their race's enemies would never find him. Barash was placed in a holodeck-like environment and equipped with neural scanners which could read his mind and fulfill his desires and needs. However, the fantasies the scanners created were no substitute for real interaction with other sentient beings.
In early 2367, when the USS Enterprise-D was investigating the source of an energy probe from Alpha Onias III, Commander Riker led an away team to a cavern complex below that planet's surface. After they arrived in the cavern, the members of the away team were overcome by volcanic gases. Lieutenant Worf and Lieutenant Commander Geordi La Forge were beamed back to the Enterprise-D, but Commander Riker was trapped on the planet.
Barash hoped Riker would stay to keep him company. When Riker regained conciousness, he was confronted by an Enterprise-D now sixteen years into the future. Dr. Crusher claimed that he had been infected by Altarian encephalitis and had lost all memories since Alpha Onias III. He was now captain of the Enterprise-D and a single parent with one slightly troublesome child, "Jean-Luc Riker". "Admiral" Picard then arrived on a Romulan warbird with a diplomatic delegation. Riker was to complete the final peace accords with the Romulans, which he had been working on ever since the Enterprise-D rescued a damaged Romulan ship. Although Riker began to accept his new circumstances and give the young "Jean-Luc" attention, the simulation quickly began to fall apart as the neural scanner technology was not able to keep up with Riker. In the simulation, the Enterprise-D computer was much too slow and the senior staff were unable to answer Riker's questions about the previous sixteen years. Moreover, a recording of his wife revealed Minuet, a former holographic fantasy of Riker's.
This illusion then gave way to another, in which Riker was imprisoned in a Romulan laboratory. Barash stayed in the form of the child, now called "Ethan". Riker and "Ethan" plotted an escape, but Riker figured out this second deception when "Ethan" accidentally called Tomalak "ambassador", a rank he held only in the first illusion. Barash then revealed his true nature to Riker. Will offered him safety and companionship aboard the Enterprise-D, and the two transported back to the ship. (TNG: "Future Imperfect")