Jesus spoke many times in parables to the people and when His disciples asked Him why He explained that they understand His teaching because they walk with Him. Others however do not understand the mysteries of Gods kingdom because they have not yet repented of their sins so that they may be converted unto the truth (Mark 4:10-12) 10 And when he was alone, they that were about him with the twelve asked of him the parable. 11 And he said unto them, Unto you it is given to know the mystery of the kingdom of God: but unto them that are without, all these things are done in parables: 12 That seeing they may see, and not perceive; and hearing they may hear, and not understand; lest at any time they should be converted, and their sins should be forgiven them.
When a person truly repents their eyes and ears are opened and then have the ability to understand the mysteries of Gods kingdom. This shows us just how much God loves those who choose Him over the worlds ways. They are ever able to learn of His mysteries which explains the passage don’t cast your pearls among the swine. The truth of His kingdom is a real treasure not to be trampled and cast aside! (Colossians 1:26-29) 26 Even the mystery which hath been hid from ages and from generations, but now is made manifest to his saints: 27 To whom God would make known what is the riches of the glory of this mystery among the Gentiles; which is Christ in you, the hope of glory: 28 Whom we preach, warning every man, and teaching every man in all wisdom; that we may present every man perfect in Christ Jesus: 29 Whereunto I also labour, striving according to his working, which worketh in me mightily.
The mysteries of God are revealed to us by the holy spirit to those who have faith and are obedient to His ways (Romans 16:25,26) 25 Now to him that is of power to stablish you according to my gospel, and the preaching of Jesus Christ, according to the revelation of the mystery, which was kept secret since the world began, 26 But now is made manifest, and by the scriptures of the prophets, according to the commandment of the everlasting God, made known to all nations for the obedience of faith. (John 16:13-15).