It is spontaneous. You cannot predict exactly when a nucleus will decay.
But, there is a certain probability that it will decay. The decay constant λ is a measure of this.
If you have a large enough number nuclei together, a certain fraction of them will decay in a particular length of time.
In fact, the half life T1/2 is that time after which half of them would be expected to decay.
This is observed to happen.
That varies from material to material.
Clearly, the time it will take half of them to decay depends on the chance of the nucleus decaying in the first place.
If the probability λ is small, it will take longer for half the sample to decay.
If the probability λ is high it will take a shorter time for half the sample to decay.
There is an equation that relates λ and T1/2
The activity of the sample depends on how many active nuclei are present, so if half have decayed, the activity is also reduced by half.
It all depends on there being a very large number of nuclei present. In this case then, it is possible to predict the behavior of the sample based on this idea of probability of decay, even though the decay event is random.
An analogy would be throwing coins.
We cannot predict if it is going to be head or tail, but we do know that there is a 0.5 probability (50% chance) of it being a head. This is indeed random.
But if I have enough coins and throw them all, I know that about half of them will be heads and half tails. The more coins I have, the closer it will be to half heads and half tails,
In the case of a radioactive sample we have a lot (millions) of nuclei.