Question: why hufflepuffs and slytherins get along?
Answer: Because Hufflepuffs are extremely loyal, they are probably more inclined to hold on to their values. And because Slytherins are ambitious, they also don't change their minds very easily. So when both the Hufflepuff and the Slytherin share a common goal, they could do great together.