As said, cats scratch to express territorial behaviour, which is the last point. Scratching allows them to mark their territory as they have scent glands in their paws. This movement helps them settle in their territory and establish that this is their area of comfort.