Well, at first it was implied that Shanks simply loves to live a free life & chill in random islands where he feels comfortable.
For example when Mihawk met him during East Blue Saga, he said "Your captain is an easygoing man, if he camp on such an Island..."
After that, we saw that Makino has a Child, so Fandom started to believe that Shanks is the Father & that's why he was spending time in that Island. But it became a weak argument over time.
Then it was revealed that Shanks told Rayleigh: "He said the same words as Roger" referring to Luffy & that's why he sacrificed his Arm for him & gave him his Hat. At first it's implied he is referring to when Luffy said "I'm gonna gather a Crew greater than yours & become Pirate King".
But the problem is that everyone says that, if Shanks only saw the resemblance with Roger because of that then he could have given the Hat to anyone really.
And then we learned that Shanks stole Sun God DF from Government & we also know that Luffy's Island is also where Ace is living who is Roger's Son. So here is my take on this:
01. Roger told his Crew about his Unique Secret Dream (The one he also told WB & Oden)
02. This Same Dream has only been said by Luffy (The one he told Ace & Sabo)
03. This Dream makes Half People Shocked & Half People Laughing due to how Ridiculous it is & Unthinkable
- This is also why Rayleigh told Robin that once they discover the Truth, they might have a different Conclusion
04. Roger Pirates travelled to Final Island & learned the Truth
05. To their Shock, they learned that Joy Boy had exactly the same Dream as Roger
06. Which is why they "Laughed" !!! (Just like WB & Ace laughed at Roger/Luffy's Dream)
07. After long time, Shanks stole Sun God DF due to how important it is
08. He believed that if anyone deserves that Fruit then it must be Roger's Son
09. Actually Roger himself believed that his Son would be the person they are waiting (Conveniently Oden also thought the same about Momo)
10. So Shanks travelled to Dawn Island to give Sun God DF to Ace
11. During his Stay, he met Luffy & befriended him & that's when Luffy said same words as Roger (This happened Off-Screen cuz it's a Secret)
12. But Shanks wasn't ready to entrust Luffy with his Hat because he didn't see enough Motivation yet
13. But when Luffy accidentally ate Nika DF & later showed his Resolve that he will Surpass Shanks & become PK, Shanks decided he is The One
Does this make sense & answer your question?