Bonds was one of the 10-15 greatest hitters of all time and was going to make it to 40 regardless. Juicing was what spiked his production back up and gave him a second prime in his mid to late 30s.
I'm on (extremely long) record in one of these threads about how the body armor he was grandfathered into being allowed to wear is what pushed that second prime into superhuman status, but I don't really want to revisit it here.
Careers and primes are longer and later now, but in general I think it's more due to dramatically better strength and conditioning than anything else.