The term comes from the 1800's in America. A horse is actually not a very intelligent animal. However, it is highly instinctive and follows a set of very common sense rules. It runs from danger, it tries to stay in a pack for protection, it seeks out food, it protects its young. These actions became known as "horse sense". So anyone with horse sense is displaying a good level of common sense.