⚠️ spoiler alert!
In the first episodes we saw that shanks did stole Gum Gum fruit from government in a special voyage that he and his crew went on just to gain access to this special fruit, and in return Shank's daughter mysteriously took a separate way from his dad and left the ship. Then in an accident luffy ate Gum Gum fruit and then Shanks tried to take it back from Luffy's stomach but failed. Then shanks saved Luffy from the sea king and sacrificed his left arm. Later in epiode 316 shanks told Edward Newgate aka White beard that the reason he lost his left arm was "bet on the new era!" And he asked White Beard to stop Portgace D. Ace chasing Edwad D. Tatch aka Black Beard, and White Beard refused it. Later in story (around 1020 episode or so) we see Shanks is secret king in Marie Jois holy city and there is a gigantic straw hat in the basement of Mari Jua castle of 5 Elder Stars and that too Shanks went on a special meating with 5 Elders about certain Pirate group which was Strawhat Luffy's group.
So...my theory is ; Shanks is a bad guy, who sees Gum Gum Fruit as a danger to his throne (Throne in Mari Jois), so he wanted Nika God Fruit be under his control but he accidentally lost it when Luffy ate eat(remember 5 elders told us it is as if Gum Gum Fruit always escaped from the hands of 5 Elders in the last 800 years!), so Shanks gave his arm (or pretended to! As we saw in one episode that he still has two arms!) in order to gaining trust of Luffy and keep an close eye on Gum Gum person at least until when he can find a way to regain Gum Gum Fruit or extract it from Luffy's body again (notice there is just one special Devil Fruit which it has power of Darkness, BlackBeard Dark Dark fruit, and can be used to acquire power of another devil fruit from a living power user ), so Shanks had no choice but to let Luffy goes and then find a way. So Shanks goes to BlackBeard and told him to study about Devil fruits and keep searching for a special one (Dark Dark Fruit) ,, BlackBeard find it and eat it, instantly he wants go after Luffy in Water 7 island, but Ace intercepted and fought with BlackBeard, but Ace lost...not by BlackBeard's power, but to Shanks interception in the fight, which we didn't see result of the fight in that episode!! Shanks wants BlackBeard acquiring Gum Gum Fruit from Luffy's body when Luffy is still Alive, because if Shanks kills Luffy then no one can guess Fruit will be reincarnated where in the world! So Fruit and it's power just can be extracted from living body of Luffy by Dark Dark Fruit Owner aka Blackbeard. when Shanks find out that Portgace D. Ace is going after BlackBeard, he has feared that there is a chance Ace kills BlackBeard and whole plan be destroyed, so Shanks goes straight to WhiteBeard to asking him stopping Ace and chasing BlackBeard, but after WhiteBeard refusal, Shanks personaly goes after Ace and captured him and gave its credit to BlackBeard, just to preventing luffy to find out that Shanks was true culprit and mastermind behind Imprisonment of Ace and ultimate enemy of Luffy and Joyboy...
.......
sorry for long comment, there is still more to my theory but i refuse to bother you more.
Also sorry for weak English Grammer of mine! 🙏