There was more than one power at work, Frodo. The Ring was trying to get back to its master.
It had slipped from Isildur's hand and betrayed him, then when a chance came it caught poor Deagol...when its master was awake once more and sending out his dark thought from Mirkwood, it abandoned Gollum. Only to be picked up by the most unlikely person imaginable: Bilbo from the Shire!
Behind that there was something else at work, beyond any design of the Ring-maker.
I can put it no plainer than by saying that Bilbo was meant to find the Ring, and not by its maker.
In which case you also were meant to have it. And that may be an encouraging thought."
Gandalf to Frodo, The Fellowship of the Ring