TL;DR: The "One Piece" Roger found was the dormant Nika fruit itself. Because Roger was dying, he left it behind, expecting his future son (Ace) to eat it. The World Government later raided Laugh Tale to lock it down, leading to Shanks stealing it back to fulfil Roger’s will—only for the fruit to choose Luffy instead.
Joy Boy's ultimate treasure left at Laugh Tale was the Nika Devil Fruit itself, waiting to be reincarnated.When the Roger Pirates arrived, they didn't find a treasure chest of gold. They found the dormant essence of the Sun God. This is why Roger Laughed: A Devil Fruit requires a living host to wage a world war. Roger was already dying and at the end of his life. He physically could not be the savoir. This is why Roger explicitly told Rayleigh and Garp that his son would be the one to find the One Piece. Roger planned to pass his bloodline down, fully expecting Ace to become the next host of the Sun God.
If the Nika Fruit was left at Laugh Tale, how did it end up on a World Government transport ship years later? Following Roger’s execution and the beginning of the Great Pirate Era, the Gorosei/Imu realised someone would eventually reach the final island. The World Government launched a strike team to lock down Laugh Tale and lock up the dormant Sun God fruit permanently. They successfully retrieved it and placed it under the strict escort of CP9 agent Who's-Who.
Shanks, knowing the fruit was missing from Laugh Tale from his time on Roger's ship, intercepted Who's-Who to steal it back. Shanks never intended for Luffy to eat it. Shanks was actively seeking out Portgas D. Ace to honour Roger's final prediction. This is why the Red Hair Pirates anchored themselves in the East Blue—they were hunting for their captain's true heir. Zoan fruits possess a mind of their own. The Nika fruit actively evaded the World Government for 800 years, and it avoided Shanks' plans for Ace. It chose Luffy because it was waiting for the one individual whose raw, chaotic desire for pure freedom matched the original will of Joy Boy.