Beloved, persecution is defined as hostility and ill-treatment, especially because of race or political or religious beliefs, causing the persecuted person to suffer because of their belief.
Acts 4 is more than a historical record. It is a template for all disciples of Jesus to follow when (not if) persecution comes. Acts 4 is one of those chapters in which we would do well to spend focused time, meditating and soaking up the truths, so that they may become part of our innermost being (Jn 17:17). Peter and John's response to persecution teaches us how we are to respond to persecution.
Peter and John were surely not surprised for Jesus had taught them "Remember the word that I said to you, ‘A slave is not greater than his master.’ If they persecuted Me, they will also persecute you; if they kept My word, they will keep yours also." (Jn 15:20)