During gastrulation, cells of the early embryo reorganize into the three germ layers. The mesoderm forms through a process called ingression, where cells migrate inward from the outer layer. This layer then differentiates into various subtypes, such as paraxial, intermediate, and lateral plate mesoderm, each contributing to different tissues and organs.