The "when" is simpler and better understood than the "why" part. First articles expressing complete surprice at the turnaround started comming out around 2006-2007.
tl;dr (skip to the last paragraph for the summary)
Putin's political party created a youth organization whose name NYTimes translated as "we". It was reported to be a party-sponsored organization akin to the "young pioneers" of the Communist era. But at that time Russian Federation still had multiple competitive political parties. So a youth organization of a political party seemed completely out of place given that the Russian popular culture still considered Soviet era a joke of the past. But there was a consolidation of economic power under the umbrella of Gazprom while, at the same time, many of Gazprom executives were also government members (again, I am saying this based on a number of reports I read around those years in the US press). This put Putin's political party in the position of being both in charge of large parts of the economy (through direct ownership) and in the position of majority in the government.
Which brings us to the "why" part. This is best explained with a Star Wars quote. Cheesy as it may be, Leia, at some point, said to Tarkin, "the more you tighten your grip, the more systems will slip through your fingers." And this is what happened. A lot of independent economic power houses arouse in RF as a result of bringing a western-style economy to RF. They were more powerful than the government and could challenge government authority by being able to corrupt any government institutions which would attempt to curtail their power.
Putin's response was two-pronged. Politically, he initiated a campaign of ultra-nationalism. Economically, he started flexing the muscles of the state to arbitrarily enforce arcane laws in order to force most successful independent business to sell controlling interest of their shares to Gazprom. This turned the government from a weak ineffectual paper institution into the strongest economic player in the country.
And this is where the "losing the grip on power" happened. No one individual can do more than what can be done in 24 hours a day. Most people who spent lifetimes or generations to acquire influence have vetted individuals, and created institutions for vetting individuals, who were loyal to them.
The rise of Putin's influence happened in a very short time -- 5 years or less. Which meant that the newly acquired power had to be shared with those who helped to acquire it, but who had their own agendas. It may not look like it, and the illusion depends on it looking otherwise, but when most of the power is in the hands which do not have intricate dependence on the leader, then those behind the leader are the ones wielding the power.
Power to destroy can only act as a deterrent. But power to enable empowers daily. The Gazprom became the new apparatchiks. They controlled the economy and they controlled the presidency by controlling what the president could do. But the consolidation of political power doomed the civilian institutions.
The first time there was a manufactured military crises (and it turned out to be Georgia), the military took the chance and asserted itself as the dominant national institution. From that point on, the rhetoric of Russian political discourse was from the point of view of military might. The state propaganda slowly turned the view of everything else as somehow incorporated into the military view of society.
The ascension of the military class was completed with the invasion of Crimea. After that, all institutions became subservient to the military.
For example, it is now not uncommon to see a Russian on the Internet to attribute to NATO-member countries characteristics found in Russia (I've seen arguments against "NATO-propaganda" and such). To the people living in these NATO-member countries these arguments sound like nonsense because these characteristics simply aren't present. But, convinced by the internal Russian propaganda, even the English-speaking Russians have come to view the world from the point of "but they are doing the same thing, so it's ok that we do it."
This isn't the same Putin who came to power to replace Yeltsin in an effort to continue building Democracy in Russia. He lost the power to reform. He lost it by concentrating too much power at the top and then not being able to wield it.