I don't think the books ever went into much detail, but from this...
Book III, ch.10:
‘Behold, I am not Gandalf the Grey, whom you betrayed. I am
Gandalf the White, who has returned from death. You have no colour
now, and I cast you from the order and from the Council.’
He raised his hand, and spoke slowly in a clear cold voice. ‘Saruman,
your staff is broken.’ There was a crack, and the staff split
asunder in Saruman’s hand, and the head of it fell down at
Gandalf’s feet. ‘Go!’ said Gandalf. With a cry Saruman fell back
and crawled away.
Book 6, Ch.8:
A sudden light broke on Frodo. ‘Sharkey!’ he cried. Saruman laughed.
‘So you have heard the name, have you? All my people used to call me
that in Isengard, I believe. A sign of affection, possibly.
But evidently you did not expect to see me here.’
‘I did not,’ said
Frodo. ‘But I might have guessed. A little mischief in a mean way:
Gandalf warned me that you were still capable of it.’
‘Quite capable,’ said Saruman, ‘and more than a little...
...it would seem that Gandalf removed Sarman's power. At least, Saruman's greatest capital-P Powers; Saruman still has some abilities, but nothing beyond the reach of any "ordinary" (i.e. non-Maiar) being in Middle-earth. Could Saruman have redeemed himself? Maybe,...
Book III, Ch.10:
‘He will have guessed, surely?[re. Treebeard]’ said Merry, ‘Were they
likely to end any other way?’
‘Not likely,’ answered Gandalf, ‘though they came to the balance of
a hair. But I had reasons for trying; some merciful and some less
so. First Saruman was shown that the power of his voice was
waning...Then I gave him a last choice and a fair one: to renounce
both Mordor and his private schemes, and make amends by helping us
in our need. He knows our need, none better. Great service he could
have rendered. But he has chosen to withhold it, and keep the power
of Orthanc...He lives now in terror of the shadow of Mordor, and
yet he still dreams of riding the storm. Unhappy fool! He will be
devoured, if the power of the East stretches out its arms to
...but Saruman was given a last choice, and he still chose "the dark side".
Did Gandalf remove Saruman's power himself, or was it a Higher Power (the Valar or Ilúvatar themself)? I think it depends on how you want to look at it. An executioner acts on the order of the Monarch/Judge/whatever, with the "Power" of the throne/gang/society/legal system behind them, but it's still the executioner that pulls the lever/chops the head/pushes the syringe. If Saruman had shown any redeeming qualities, Gandalf could have chosen to give him a second chance. But Saruman refused the offer, so Gandalf chose to break him. In the end, it's always the choice of the person with their finger on the trigger. Which is a very Roman Catholic point-of-view, but as Tolkien was a Catholic I think that's how it was meant to be read.