Now during Peter's sermon, the light switch was turned on, the veil over their eyes was removed, as it were, and they recognized what they had done. Now God did that through Peter's message. God revealed what they had done, and the awareness of a need to change occurred.
These verses basically show the process in action. God calls and reveals Himself to us and how corrupt we are and we respond by believing and doing, believing in God and His Word, repenting and being baptized that we might receive the gift of His Holy Spirit.