Also why did they demand that Trotsky and other Bolshevik members be released in order to deal with Kornilov? Couldn't a defense be made through the Soviets alone?
Let me put it this way: the Soviet movement was a disparate collection of parties and worker/soldier organisations. The short answer is that by August 1917 the Bolsheviks were increasingly the key component of this movement.
The Bolsheviks weren't as popular as they'd become post-Kornilov but their surge in popularity was already underway. The fiasco of the July Days had failed to blunt their appeal to an increasingly radicalised working class, or address the detachment of the Soviet leadership from the same.
Crucially the Bolsheviks predominated in several key bodies. In particular, they enjoyed the support of the most militant organisations: the Military Revolutionary Committee, Red Guards, factory committees, etc. These were not, as histories sometimes present, exclusively Bolshevik bodies. But while, party affiliation is notoriously hard to judge in hindsight, they were generally responsive to Bolshevik policies and sometimes specific instructions.
And the reverse was true: as the Bolshevik policy of opposing the Provisional Government grew in popularity, so the Soviet leadership's opposing policy of cooperation shrank. This was thrown into sharp relief by the Kornilov Affair itself, which seemed to vindicate the Bolshevik warnings about Kerensky.
So the challenge facing the Soviet leadership was therefore how to mobilise its constituency to defend Petrograd in the light of two problems:
The attempted coup undermined the basis for the policy of repressing the Bolsheviks. The latter's slogan of 'Unity in action for all parties represented in the soviet' was both popular and hard to refute. It was politically difficult to both fight the Right and lock up members of the Left who were volunteering to do the same.
If the Soviet was to actually defend Petrograd then it needed to arm the workers. In particular it needed to rely on precisely those bodies in which Bolshevik influence was strongest.
That is, a reconciliation with the Bolsheviks was both politically and militarily necessary for the Soviet to defend itself. (It goes without saying that the Provisional Government was of little use.) As Sukhanov put it in his Personal Record:
The [Soviet's Committee for Struggle Against the Counter-Revolution] had to mobilise the worker-soldier masses. But the masses, insofar as they were organised, were organised by the Bolsheviks and followed them. At that time, theirs was the only organisation that was large, welded together by an elementary discipline, and linked with the democratic lowest levels of the capital. Without it the committee was impotent. Without the Bolsheviks it could only have passed the time with appeals and idle speeches by orators.
Sukhanov overplays the element of 'discipline' amongst the Bolsheviks, as all external observers were wont to do, but his point is valid. The Bolsheviks were simply the largest, or at least most coherent, party in Petrograd at the time.
In March or April the Mensheviks and SRs could have led the line against Kornilov but by August the momentum was with the Bolsheviks.