During mitosis, the chromosomes eventually separate to opposite ends of the cell so that the cell can divide into two. Mitosis is the process where one cell replicates and becomes two daughter cells. The chromosomes move to opposite ends gradually over the course of four phases.
The first phase is prophase, where the chromatin begins to organize itself into tightly-packed chromosomes. This is also where the chromosomes start to cluster within the parent cell. Prior to prophase, DNA replication occurs, which is an entirely different process and is not generally considered part of mitosis.
The second phase is metaphase, where the chromosomes align in the middle of the cell. This area is called the metaphase plate. During this second phase, the spindles begin to form.
During anaphase, those spindles reach out to the chromosomes in the center of the cell and pull them toward opposite sides. The microtubules shorten in the process.
The last phase is telophase, in which this whole process finishes up, and the daughter cells are completed. The DNA in both these cells is perfectly identical. During telophase, the chromosomes that were pulled apart during anaphase condense again, and a cell membrane forms to differentiate the two cells.