The border collie was originally a herding dog. They feel safer when they’re in a pack so they would follow you around. So, you could say it’s instinct. They could also do this if they’re bored.