Do not give your Pearls to Pigs
I think that Jesus is trying to teach us that we should understand the people we are trying to share the Gospel with. Some people are really like pigs, who if you give a pearl to they are just like a pig that doesn’t understand the value of what you are trying to give them and will trample the pearl into the ground. So you were wasting your time on the pig.
So Jesus is trying to illustrate that just like it is stupid to give a pearl to a pig because it doesn’t understand the value of the pearl, so it is stupid if you as a Christian try to share the Gospel with a person who is (spiritually) like a pig . In fact you are being stupid because you are completely wasting your time. So you have to understand the person you are sharing the Gospel with and be more wise about what you are doing.
Also Pigs were unclean animals at the time according to God’s commands to the Jewish people before Jesus made every type of food clean and allowable. So at the time when Jesus used the metaphor of a Pig to illustrate his point, the Jewish audience would have known he was talking about an unclean person who in his spiritual state of sinfulness, depravity, and lowliness would be like a Pig (spiritually) and not be receptive to the Gospel (or pearl) that God wanted to give him. Therefore Christians need to be wise about who they are sharing the Gospel of God with, otherwise they would be wasting their time trying to give their pearls to pigs who will just trample it into the ground and then attack them.
Again Jesus is not telling Christians to withhold the Gospel. Not at all! He is advising Christians to understand who is receptive to the gospel so that they don’t be stupid and waste their time or put themselves in danger.
And also God is able to make people receptive so we can pray for people who are not receptive to become receptive through the Holy Spirit’s activity in their hearts.