The umbilical cord is about 30 to 60 cm in length at term. So at 36, 37 weeks it really is quite long. The important thing about it is, not only is it long, but it’s really thick. So it’s up to 2, sometimes 2 ½ cm thick, and not only does it contain two arteries and one vein. But it also contains a lot of jelly-like substance called Wharton’s Jelly that protects the blood vessels. So it really is encased in quite a thick covering and then the blood vessels have jelly around them. So that stops them getting twisted or occluded in any way.
Umbilical knots do happen occasionally when a foetus swims through a loop in the cord, but the structure of the cord makes it difficult for this to have any adverse effects. Babies jump up and down, they turn over from head down to bottom down sometimes. There has to be a great deal of tension in order for the knot to compress the cord with any significance, and therefore, impede blood flow.
Here is a good review article on cord knots.
Apparently, in some cases a cord knot is detected via ultrasound (but not all knots are found with prenatal exams). However, there are no specific treatments. Most of the time, a knot is not a problem, but a “true knot” can actually be so tight that it compromises blood flow through the umbilical cord to the baby. Probably what most people worry about when it comes to umbilical cords is that they will be wrapped around the baby’s neck. This is called a “nuchal” cord (from the Latin word for “neck”). This is much more common, occurring in up to 20% of all births, but only rarely causes problems. I’ve seen about a dozen true knots, none have been in babies with any problems.