during prophase I homologous chromosomes pair up and become attached to one another. At this time, crossing over moves sections of DNA between homologous chromosomes and allows for independent assortment.
Animation in link.
Animation in link.