Edit note: Post edited after the contents of chapter 999 where we learn of the reason why the Whitebeard Pirates did not attack Kaido during the 20 years after Oden was executed. Contrary to my belief, the Whitebeard Pirates were aware of Oden’s death albeit a few years after the fact but their hesitance in attacking Kaido stemmed from their concern of causing more damage to the people of Wano. As a result, Whitebeard ordered Ace to not target Kaido until he gets stronger.
Ace arrived on Wano Kuni nearly four years prior to the current events. Most likely the Spade Pirates Log Pose directed Ace to Wano Kuni or they were knocked off course their usual route and became swept up in the currents that led their ship up the waterfall and into Wano Kuni. During their two week stay in Wano Kuni, Ace met Tama, Kozuki Oden (Yamato) and befriended the Amigasa villagers. Ace also learned of the problems afflicting Wano Kuni and left Tama with the promise that when he returns, he will transform Wano Kuni into a place where she can eat all she wants.
I don’t believe Ace visited Wano Kuni intentionally for a specific reason save being directed there by the Log Pose as nothing so far in the story indicates anything else. Being washed ashore accidentally or directed there by the Log Pose would explain the length of time they spent on Wano Kuni (a few weeks) – repairing their ship or to have their Log Pose magnetic field set for their next destination.
Once Ace became aware of the current events in Wano Kuni, did he try and attempt to challenge Orochi/Kaido? Or on the way to Kaido, he encountered Yamato on Onigashima Island and fought? If Ace was unable to defeat Yamato, I can imagine Yamato informing Ace that he had no chance against Kaido, one of the Yonko, if Ace couldn’t defeat him. The scenario where Ace was convinced to leave Kaido alone by Yamato lest Ace had a suicidal wish is the most likely scenario playing out. At this time, Yamato probably wished to board Ace’s ship but the thought of the bomb shackles around their hands exploding prevented Yamato from taking that step. During Yamato’s interaction with Ace, Yamato would have come to learn about Luffy and what type of person Ace and Luffy are. It is also probably during the interactions between Ace and Yamato that Tama came to familiarise herself with the Kozuki name.
If Ace was dissuaded from attacking Kaido at that time until he was stronger and had more powerful allies, why did he not return after he had joined the Whitebeard Pirates? When Ace departed Wano Kuni, he promised Tama that he will return and ensure that when he does, Wano Kuni will not be a country where she will go hungry in. Ace had every intention of returning to Wano Kuni to help the residents he met during his time there, especially Tama. So why had he not returned when he became a member of the Whitebeard Pirates? Once Ace met Whitebeard, Marco and Izo and mentioned his time on Wano Kuni, why were they not motivated to attack Kaido and rest Wano Kuni away from Kaido’s control? Trying to answer that question leads to another question – were Whitebeard, Marco and Izo even aware that Kozuki Oden was executed 16-17 years prior to Ace joining the Whitebeard Pirates?
Wano Kuni is a closed border nation that is not a member of the World Government. Just as how the information that enters the country is controlled, so to is the information that leaves. If Orochi and Kaido did not want the world to know that Kozuki Oden had been executed, they would not allow that information to escape. The citizens of Wano Kuni weren’t able to leave. The Akazaya Nine that were not cast twenty years into the future remained in Wano Kuni (Denjiro and Ashura Doji). Kawamatsu remained in Wano Kuni to care for Kozuki Hiyori and 13 years before the current events, he was captured by the Beast Pirates and imprisoned in Udon. Kin’emon, Kikunojo, Kanjuro and Raizo were sent twenty years into the future along with Momonosuke. Inuarashi and Nekomamushi were captured by Orochi’s forces but eventually escaped and made their way to Zou barely alive. Zou also operates in a very restricted manner with little to no interaction to the outside world. For the past 1,000 years, the Mink Tribe has remained isolated from the other human civilizations. As a result, Inuarashi and Nekomamushi waited for the foretold 20 years time rather than seeking aid from the Whitebeard Pirates or the Roger Pirates that remained to help depose of Kaido and Orochi. Inuarashi and Nekomamushi during the past twenty years likely never told Whitebeard, Marco, Izo and the other Whitebeard Pirates what exactly happened in Wano Kuni on that day.
If Ace was under the impression that Kozuki Oden was alive when he left Wano Kuni (given that is how Yamato would have introduced themself) and conveyed such to Whitebeard, Marco and Izo, would they have recognised the urgency in the Wano Kuni situation? Their perception of Oden could have tainted their judgement and led them to conclude that with Oden present in Wano Kuni, there was no need for them to involve themselves in the nations political situation. Even Izo, who was one of Oden’s retainers may have felt guilt for leaving him and staying with Whitebeard. Izo may have felt it was not his place to interfere in Oden and Wano Kuni’s affairs at that point in time regardless of how much he desired so. If we assume Whitebeard, Marco, Izo and the rest of the Whitebeard Pirates were unaware that Kozuki Oden died twenty years ago and instead thought he was alive, it makes sense why the Whitebeard Pirates did not involve themselves with Wano Kuni during the past twenty years. It would explain why after hearing the story of Wano Kuni from Nekomamushi, Marco, who was initially reluctant from going to Wano Kuni to help Luffy, decided to have Nekomamushi pick up Izo and head over to Wano Kuni as soon as possible (by flying using his Phoenix ability). Marco and Izo likely only became informed after Nekomamushi explained the history and the current events. When Yamato met Ace on Onigashima Island almost four years ago, Yamato never revealed their identity to Ace and instead portrayed themself as Kozuki Oden whom Ace likely had no idea was. Yamato found Oden’s journal in Kuri after the legendary hour long execution twenty years ago and only after she declared to Kaido that she wants to be Kozuki Oden was she imprisoned on Onigashima Island with the explosive bindings. To Ace, Kozuki Oden was alive and that is likely what he conveyed to Whitebeard, Marco and Izo when he shared his stories with them. Because of that misunderstanding, the urgency to travel back to Wano Kuni to help the people never arose. Instead, all the drama within Ace’s life during the next two years (joining the Whitebeard Pirates, becoming the 2nd Division Commander and hunting down Teach) prevented him from having sufficient time and opportunity to travel back to Wano Kuni. Ace still intended to go back to Wano Kuni to help the people and Tama but that moment likely was an act to do after hunting down Blackbeard which unfortunately led to his capture and subsequent execution at the flames of Sakazuki. I don’t see Whitebeard not targeting Kaido if he knew Kaido had a hand in killing Oden, a former Whitebeard Pirate member and a man Whitebeard declared his younger brother. The only reason Whitebeard and Izo would do nothing for the past 20 years (18 for Whitebeard) would be if they were unaware of the seriousness of the suffering present in Wano Kuni and of Oden’s execution. If Yamato were to realise that she may have been partly responsible for the continued suffering of Wano Kuni (by portraying themself as Oden), how would she feel? How would Yamato react? And would that grief allow for the bonds between Luffy, Wano Kuni and themself to grow?