This causes their angular momentum to decrease. Some of that gas, then, eventually falls onto the compact companion. A huge slowly spinning gas cloud collapses. Parts of the roughly spherical gas cloud break up into small chunks to form stars and globular clusters. As the rest of the gas cloud collapses, the inner, denser parts collapse more rapidly than the less dense parts.
Stars form in the inner, denser parts before they form in the outer, less dense parts.
All the time as the cloud collapses, the spin speed must increase. Since no outside forces produce torques, the angular momentum is conserved. The rapidly spinning part of gas cloud eventually forms a disk. This is because the cloud can collapse more easily in a direction parallel to the spin axis. The densest parts of the disk will form stars.