We believe umbilical-cord knots form as the baby moves around early in pregnancy. A loop forms in the umbilical cord; when the baby moves through the loop, a knot forms. In some cases a baby may become entangled in its umbilical cord, but usually it isn't a problem.
A tangled cord only becomes a problem if the cord is stretched tightly around the neck or another part of the body, or if it is in a tight knot. You can do nothing to prevent it. Be reassured to know these knots do not occur often.