‘Who gave himself a ransom for all.’ Not literally every single one who has ever lived, but people out of every land and nation and type, all types and groups.
To whom was the ransom paid? Say some people – and it's a foolish thing to say – that the ransom was paid to the devil. No, nothing is owed to the devil. The ransom was paid to the Father, and the indignation or wrath of God against sin was satisfied. The Son paid the Father. The Son paid the Father for our souls in his own righteousness. He rendered a perfect life of obedience on behalf of all the ransomed, and he suffered in his own body all the punishment of their sin to appease the righteous indignation of the Father against sinners.