It was primarily when Shivaji Maharaj realized that Rajgad is not as safe as he used to think.
Rajgad was the fort which used to fall under the jagir of Shivaji Maharaj’s father Shahaji Raje under the Nizam Shah. This fort was captured by Shivaji Maharaj in 1647 when he was around 20 years old. He captured this fort because it was near the jagir of Shahaji Raje, which gave advantage to Maharaj.
The mountain of Rajgad was well covered from all sides by Kondhana (Sinhgad), Purandhar, Torna and Rohida. So it was well protected plus the mountain itself was very well suitable to become a capital fort.
All was good until Mirza Raje attacked the forts, and Maharaj had to give Rajgad fort with 22 others forts to Mughals under the Treaty of Purandhar.
Rajgad can get exposed to Mughal invasion. Jaisingh showed a very different kind of generalship by spreading the Mughal forces throughout Shivaji’s territories and effectively confining Shivaji’s influence on the forts.
Second, if the protector forts of Rajgad like Kondhana and Purandhar are taken by enemy, it becomes a major threat.
Shivaji Maharaj had a safer region of Konkan down the ghats, Raigad where attacking the fort by enemies was much more difficult due to the natural barrier of Sahyadri.
Shivaji Maharaj ordered Hiroji Indulkar, construction of a fort on high mountain(1,356 metres, 4,400 ft) which had a huge area up on it.
This fort was better because,
It was at greater height than Rajgad fort.
It mountain was steeper.
It was covered with dense forest which made enemies impossible to locate fort.
The fort was deep inside the Sahayadri ranges which add more advantage.
Also Maharaj made few architectures such as top of temple similar to dome of mosque could misguide the enemies thinking that the fort is their territory and would move forward to locate the Raigad fort.
So, Shivaji Maharaj shift his capital from Rajgad Fort to Raigad Fort primarily due to safety issues.