Answer :

It was basically to eliminate those who was against their word , remember everyone was against Stalin and not with him. The great purge was basically an outbreak of anger . And Stalin was afraid that they will come after him .!

it targeted those who might challenge Stalin's power