In prophase I homologous chromosomes pair up very close together. This is called synapsis.
Each chromosome is made up of sister chromatids
The DNA is still coiling up and this can lead to a cutting of the DNA strand by another very close to it. There is a corresponding cut on the other non sister chromatid.
Now one of the non sister chromatids has joined with another
This will lead to the formation of a chiasma (plural is chiasmata). This is an X shaped structure that holds the bivalents in place. These help hold the bivalents together during prophase I and metaphase I until spindle microtubules can attach.
If crossing over has happened like shown above it means that after metaphase I two completely different chromosomes are produced. Each has a random combination of some alleles from the paternal and maternal chromosomes. This leads to a great deal of genetic diversity.