Law makes an alliance with Mugiwara to kill one of the Yonko, Kaido of the Beasts. But, why does Law want to kill Kaido? Is it because Law wants to be one of Yonko?
As per One Piece Wiki:
Trafalgar Law sought out an alliance with Monkey D. Luffy and the Straw Hat Pirates allegedly in order to dethrone Kaido. Luffy agreed to the alliance and even declared that he will defeat all four Yonko. Even though Law suggested that their chances of success are only 30%, Luffy remained undeterred. However, it is later revealed by Law himself that he only formed an alliance with Luffy because he wanted to use the Straw Hats to destroy the factory producing SMILEs to get Kaido angry at Doflamingo and not as a means to dethrone Kaido.
This was revealed in the last page of chapter 724:
It's not true.
Law has a plan to kill(or defeat) Kaido and the reason is the connection between the emeperor and Doflamingo himself(smile's factory).
Sure he wanted to defeat Doflamingo in the process, but the plan against Kaido exist anyways.