Gholas are essentially clones grown in axolotl tanks from the DNA of a subject. In the period of Dune, gholas are merely clones, but at the end of Dune Messiah, a ghola recovers the memories of the person from whom he is cloned. An important feature of the Dune universe is 'genetic memory': the ability of some (notably the Bene Gesserit) to recover, through one's genetic heritage, the memories and egos of one's ancestors. The ghola Hayt (who is a clone of Duncan Idaho) tries to kill Paul Atreides under post-hypnotic suggestion; the stress of attempting to kill someone who was deeply loved in the ghola's previous incarnation breaks the mental barrier between the ghola's consciousness and the genetic memory of the cloned subject (though not between the subject and his ancestors).
This discovery has tremendous consequences: In the first four books, the Bene Tleilaxu are the only ones with the technology of axolotl tanks. The Tleilaxu masters use the ability of a ghola to recover its memories to grant themselves effective immortality: every master is cloned upon his death, and recovers his genetic memories, accumulating many incarnations worth of knowledge and experience, and permitting planning on a timespan of millennia. Likewise, in God Emperor of Dune, Leto II has, as constant companion, a Duncan Idaho ghola with his original memories.
In Heretics of Dune, the Bene Gesserit become the consumers of Duncan Idaho clones; when Idaho recovers his memories, he recovers the memories of all his ghola incarnations, including (apparently) gholas from whom no cells could be reovered for their genetic memory. This suggests a metaphysical commitment that is never explored in the novels.