From Wiki

A ghola is basically a clone of a person. The difference between a clone and a ghola lies in the fact that a ghola is created from cells of a dead body. Most gholas are created by the Tleilaxu, masters at genetic engineering who sell gholas to whoever is wiling to pay for them. Before the events in Dune Messiah, it was deemed impossible for a ghola to remember anything of his previous life. The events in Dune Messiah showed that it is, in fact, possible for a ghola to recall everything the original person knew through the concept of genetic memory. However, the process requires the ghola to undergo a traumatic event, in the case of the Duncan Idaho-ghola Hayt in Dune Messiah, the urge planted in him by the Tleilaxu to kill his former master Paul Atreides.