Compression of the cord can occur when the cord is pressed between a part of the baby and the uterine wall. This can happen during a contraction or when the baby moves. The cord may stretch as the baby is moving down. This causes the cord to spasm and the cord blood flow to temporarily stop. This is part of a built in reflex to allow the blood flow to stop once the baby is born. Both compression and stretch can be usually be tolerated fine by the baby.
Obstetrics: Normal and Problem Pregnancies, 5th ed. Gabbe et al.
Fanaroff and Martin's Neonatal-Perinatal Medicine, 8th ed. Martin et al.