Mitosis and meiosis both condense chromosomes and move them accurately between new nuclei.
Histones organize DNA into nucleosomes, and further supercoiling condenses the long chromatin fibres into compact chromosomes that can be moved without tangling.
Spindle microtubules attach to chromosomes, and microtubule motors plus microtubule shortening or growth generate directed movement. Alignment and separation differ between divisions, but the same general machinery organizes chromosome distribution.
In both mitosis and meiosis II, sister chromatids move toward opposite poles; in meiosis I, homologous chromosomes move apart while sister chromatids remain together.
Shared condensation and movement mechanisms do not make the outcomes identical: the chromosome partners separated and the number of divisions differ.