When the One Ring was forged, Sauron imparted it with a piece of his power and will to rule.
Now the Elves made many rings; but Sauron made One Ring to rule All the others, and their power was bound up with it, to be subject wholly to it and to last only so long as it too should last. And much of the srength and will of Sauron passed into that One Ring; for the power of the Elven–rings was very great, and that which should govern them must be a thing of surpassing potency; and Sauron forged it in the Mountain of Fire in the Land of Shadow.
― The Silmarillion: of The Rings Of Power And The Third Age; § 3, ¶ 5
Sauron, appearing as Annatar to the Elven smiths of Eregion, learned from them the art of crafting the Elven–rings, or rings of power.
First, we should understand exactly the nature of those rings' relationship with their wielder.
[…] Sméagol returned alone, and he found that none of his family could see him, when he was wearing the ring. He was very pleased with his discovery and he concealed it; and he used it to find out secrets, and he put his knowledge to crooked and malicious uses. He became sharp–eyed and keen–eared for all that was hurtful. The ring had given him power according to his stature.
― LOTR; bk 1, ch 2, § 10, ¶ 9
That is the sort of behavior we see with Gollum. He found it and hid it away, eventually taking a residence under the Misty Mountains.
‘And now at last it comes. You will give me the Ring freely! In place of the Dark Lord you will set up a Queen. And I shall not be dark, but beautiful and terrible as the Morning and the Night! Fair as the Sea and the Sun and the Snow upon the Mountain! Dreadful as the Storm and the Lightning! Stronger than the foundations of the earth. All shall love me and despair!’
― LOTR; bk 2, ch 7, § 9, ¶ 18
That's what Galadriel would want to do with it when Frodo offered it to her — granted, she resisted the temptation and never did take it from Frodo, so we don't know what actually would've happened.
Let us not forget what Gandalf thought would happen if he were to wield the One Ring:
‘No!’ cried Gandalf, springing to his feet. ‘With that power I should have power too great and terrible. And over me the Ring would gain a power still greater and more deadly.’ His eyes flashed and his face was lit as by a fire within. ‘Do not tempt me! For I do not wish to become like the Dark Lord himself. Yet the way of the Ring to my heart is by pity, pity for weakness and the desire of strength to do good. Do not tempt me! I dare not take it, not even to keep it safe, unused. The wish to wield it would be too great for my strength. […]
― LOTR, bk 1, ch 2, § 13, ¶ 9
This was the first time Frodo was asking whether someone else would be willing to take the Ring. Of course, at this time, the plan was simply to take it to Imladris (Rivendell) — it had not yet been decided whether it should be taken to Mount Doom.
Gandalf rejected it on the grounds that the Ring would overpower his base wishes by perverting them; he did not fear that he would return the Ring to Sauron, though.
Something similar was described as to Saruman, but we only read about that in a brief report through Gandalf — which, granted, was also the case with the Sméagol quote back there.
What about Samwise the Stout-hearted?
His thought turned to the Ring, but there was no comfort there, only dread and danger. […] As it drew near the great furnaces where, in the deeps of time, it had been shaped and forged, the Ring's power grew, and it became more fell, untameable save by some mighty will. As Sam stood there, even though the Ring was not on him but hanging by its chain about his neck, he felt himself enlarged, as if he were robed in a huge distorted shadow of himself, a vast and ominous threat halted upon the walls of Mordor. He felt that he had from now on only two choices: to forbear the Ring, though it would torment him; or to claim it, and challenge the Power that sat in its dark hold beyond the valley of shadows. Already the Ring tempted him, gnawing at his will and reason. Wild fantasies arose in his mind; and he saw Samwise the Strong, Hero of the Age, striding with a flaming sword across the darkened land, and armies flocking to his call as he marched to the overthrow of Barad–dûr. And then all the clouds rolled away, and the white sun shone, and at his command the vale of Gorgoroth became a garden of flowers and trees and brought forth fruit. He had only to put on the Ring and claim it for his own, and all this could be.
― LOTR; bk 6, ch 1, § 5, ¶ 1
Not in the style of Sauron at all, but certainly in line with his motive: Whereas Morgoth was driven to pervert and befoul all of Arda, Sauron's was simply to control and to enforce order. (Explaining those two characters would be far too much for this small commentary.)
I see no reason to doubt that such a thing could've actually been attempted by Samwise. He could fail in the attempt, and probably would, but he wouldn't necessarily be twisted so far as to, in the end, arrive fawning at Sauron's doorstep.
Frodo, however, felt different urges for the ring:
This is quite verbose as it is, so I will summarize to say that Frodo felt the urge to place the ring on his finger whenever the Nazgûl were nearby. This is twice described as a command which he feels imposed upon him, rather than an expression of his own inner yearnings.
Frodo, almost unique of all the other Ring–bearers, wanted less to use the ring than to be rid of it — and possibly, to obey the requests of others.
Avoiding a discussion as to whether the One Ring could reason or think of itself, I believe that it is evidently a vessel of Sauron's raw desires and wishes. To each bearer, the Ring acts as both a sort of magnifier and a chunk of influence. It compells the bearer, so far as it is able, to be more like Sauron, exactly as it would with Sauron himself.
Gollum, of course, was a very mean (petty), greedy, covetous, and sneaky person. There are other passages which help us to see the sort of Lord he would be if he so used the Ring:
‘But He'll see, He'll know, He'll take it from us!’
‘He sees. He knows. He heard us make silly promises — against His orders, yes. Must take it. The Wraiths are searching. Must take it.’
‘Not for Him!’
‘No, sweet one. See, my precious: if we has it, then we can escape, even from Him, eh? Perhaps we grows very strong, stronger than Wraiths. Lord Sméagol? Gollum the Great? The Gollum! Eat fish every day, three times a day, fresh from the sea. Most Precious Gollum! Must have it. We wants it, we wants it, we wants it!’
― LOTR, bk 4, ch 2, § 13, ¶ 17
That, I think, is the most telling passage of how Gollum–slash–Sméagol thinks about the Ring while he is guiding Frodo and Samwise to Mordor.
There we see Sméagol's alter ego — Gollum proper, as Samwise supposed — attempting to comvince Sméagol to take the ring from Frodo and to not give it to Sauron, as he evidently was commanded to do, but to keep it for himself.
Why did Gandalf explicitly say something like this?
[…] The Ring was trying to get back to its master. […]
― LOTR, bk 1, ch 2, § 11, ¶ 14
I don't believe he was saying that the Ring wanted Sauron solely. Perhaps that is what Gandalf thought at the time, but I believe it was more likely that the Ring simply sought someone who would be like Sauron: someone who would be a suitable fit for its manifestations.
It abandoned Gollum because he became reclusive, but did not itself choose Bilbo because it plotted to return to Sauron. Indeed, it probably didn't choose Bilbo at all.
[…] I can put it no plainer than by saying that Bilbo was meant to find the Ring, and not by its maker. […]
― LOTR, bk 1, ch 2, § 11, ¶ 15
Which has, of course, been argued by a few other Tolkienology scholars to be Tolkien's way of explaining the recovery of the Ring as a miraculous intervention by Eru. Ergo, that Bilbo was not a preferrable host for the Ring, and that the Ring would've probably rejected him either initially or as soon as it was free of Gollum.
Gollum was indeed tempted by the Ring, and although it is unlikely that Gollum would've been able to properly wield it against Sauron's servants, and to thus prevent it from returning to Sauron, I believe it is evident that the Ring sought to manifest the will which was poured into it, rather than simply to return to Sauron because it shared some likeness with him.