The concept is similar to why humans extend their arms on either side of them when trying to balance. Cats may do it for the same reason- at least at first.
Even though the behavior may not look comforting, the repetitive nature of it may be soothing for cats. Repetitive movements like the pacing can be calming for both people and animals.