One of the coolest things that can happen in an anime is when two former enemies join forces to achieve a common goal. Often, this happens when a villain decides to put aside their villainous ways and join the good guys - that's what happens when Sasuke decides to help Naruto take down Madara in Naruto. But at other times, it's merely a temporary truce - Hisoka from Hunter x Hunter has no desire to side with Gon and Killua for any longer than is convenient for him.
Whether these hero/villain alliances are heartwarming or awesome, they offer a new lens through which to look at both characters, and a rare opportunity to see two very different characters cooperate.
Goku is an unabashedly heroic person who lives to fight evil. Frieza blows up entire planets because he can. One would never expect these two to see eye to eye on anything, but by the end of the Tournament of Power they're both completely on board with defeating their mutual enemy, Jiren, and saving multiple universes in the process. Frieza happens to be dead at the moment, so part of the reason he's helping his former arch enemy out is that Goku promised to bring him back via Dragon Ball. The ensuing fight is one of the most dramatic of any the franchise has ever seen.
Ed and Ling doesn't exactly want to help out a homunculus, and the homunculus in question isn't particularly interested in helping them. But despite their animosity for one another, they join forces temporarily in order to take down a mutual opponent - Gluttony's stomach. The three of them have been swallowed by Envy's partner in crime, and none of them have the strength or knowledge to escape on their own. It's only through working together that they manage to leave that labyrinth - but they're still enemies when it's over, thank you very much.
Inuyasha and Sesshoumaru are locked in a bitter feud throughout most of the series. Sesshoumaru loathes his half-human brother not only because he isn't a full demon, but also because he's jealous that their father gave Inuyasha what he perceives to the be a superior sword. The two fight more than once, and at some point Sesshoumaru teams up with Naraku to take Inuyasha down.
But as the series progresses, Sesshoumaru becomes disillusioned with Naraku, especially when he attempts to kidnap Rin, a human child who he has grown affectionate toward. For this and many other reasons he decides that Naraku needs to be taken down. In the final battle of the series - which ends in Naraku's defeat - Sesshoumaru finally puts aside his resentment toward his brother and works with him and his team to take down their mutual enemy.
Piccolo and Goku are actually allies throughout most of the Dragon Ball series, so it's easy to forget that this wasn't always true. At the beginning of Dragon Ball Z, Piccolo wanted to kill Goku and take over the universe, largely to prove his superiority. When Raditz appears with the intention of doing the same, Piccolo is so intimidated by him that he realizes he has no choice but to team up with his enemy in order to defeat this larger threat.
Despite working together, Piccolo takes the opportunity to launch an attack at both Goku and Raditz. Hey, one never said that teaming up means automatic loyalty.