The cell is equipped with an enzymatic system that tries to fix mistakes of the DNA replication process. This system, however, is not completely efficient.
DNA replication mistakes are kept in the original individual where the failure occurred when the phenomenon affects somatic cells. If a replication mistake occurs in the formation of a germline cell (e.g., in gametes) the DNA alteration may be transmitted to the offspring of the individual.