It is difficult to declare one smarter. Pigs excel at problem-solving, social complexity, and memory. Border Collies are exceptionally trainable, skilled at herding, and highly responsive to human cues. They develop different strengths based on their evolutionary needs.
Both species are intelligent in their own ways, making direct comparison subjective.