As we saw earlier that Kaido has been trying to kill himself, in fact we saw this character's first appearance where he jumped off from Skypiea in an attempt to commit suicide, landing on the Kid Pirates' hideout. So here rises a question , Why can't he kill himself? Or Why is he trying to kill himself? I'll get to that part.
As a matter of fact now we know that Kaido is trying to take full control of Wano by eliminating the current Shogun. But there also rises a question Why Wano out of all the other places in the world?.
One might say it is a close country outside Marine or World Govt's jurisdiction. But that point will not stand because Kaido is reputed as one of the the strongest living pirate. And as a matter of fact he is not afraid of the Marine or the World Govt, as we saw in the recent chapters that there was Cipher Pol Aigis Zero's agents at Wano. So it is an established fact that he is not afraid of them. Then why Wano? And Why he is sort of guarding that place or may be ruling the place ( from shadow till now ) for more than two decades? . So in conclusion we can easily say that there is something important about Wano that keeps Kaido there.
As the latest chapters reveal that Kaido knows about Joyboy. He is the first character who mentions Joyboy by name without reading any poneglyphs. This gives birth of a serious question How the hell does he knew about Joyboy?
We can guess that he learnt about Joyboy from his former crew's Captain Rocks D. Xebec.
Now here comes a fact. As Sengoku mentioned, and clearly a major portion of the marine officers didn't know about the Rocks Pirates, because that name has been clearly removed from the history as well as the incident of the God Valley.
Who in the world has the power to remove someone's name from the course of the history? Clearly it's no power of the devil fruit . No one ate "history-history" fruit and edit the history. Jokes apart , but only the World Govt. is capable of doing so.
As earlier instances like Ohara, and forbidding the research on void century and reading poneglyphs; clearly showed that the World Govt. doesn't want anyone to know about it. And if someone tries or able to know about it, then the Govt. will use everything in its power to make them stop. Even an alliance with the Gol D.Roger. (Just saying).
So it is possible that somehow (though I clearly don't know how) Xebec acquired the knowledge about the history of the world and Joyboy. That's why World Govt. used everything at its disposal to erase his name from the history.
Did Xebec was able to reach Laugh Tale?
If that is ture then Whitebeard and others will know about that. So that's not possible. But I'm sure that somehow he acquired that knowledge, which led him to his doom.
Now come to the first part of my theory
Why can't he kill himself? Or Why is he trying to kill himself?
It is now clear that Kaido learns about Joyboy from Xebec. But there's another twist. After defeating Luffy he said that Luffy couldn't be Joyboy. At which I could not help but think that Kaido is waiting for Joyboy or his reincarnation . Cause one can clearly see the frustration behind those words. It seems that given Luffy's talent and enigma Kaido thought that Luffy could be the Joyboy (or his reincarnation in that case), so he was fighting Luffy seriously. Through his desperate, failed suicide attempts Kaido has shown that there is a purpose which he has to fulfil (and maybe after that he can die), and Joyboy is the person at whose hand he will get his redemption. That's the sole possible reason behind uttering those words after beating Luffy.
And there clearly some connection between Joyboy and Kozuki clan. So if someday Joyboy appears then he has to come to Wano. So that explains why Kaido is at Wano for more than two decades.