There are those who profess faith in Christ, who participate in the means of grace in the church, who teach in the church, who perform works of mercy, etc. who never actually put their trust in Christ in a saving way. They have every outward appearance of being a believer, just as Judas did and just as those in 1 John 2:19. There are also those who do have a true saving faith in Christ who falter like Peter, who are not snatched from His hand but are preserved and restored. They are sealed unto the day of redemption because He is able to preserve them.
The question of why these warnings and imperatives would be given in Scripture in light of God's sovereignty over all things is because those are the means through which He accomplishes that preservation. The Spirit works with the Word to convict and inspire us. Could He do so without these warnings? Of course, but this is the means He has chosen (just as He chose the preaching of the Gospel as the means of bringing us to saving faith in Christ).