What you seek will eventually be seeking you. That is the wisdom that Solomon is seeking to give to his children - and God is seeking to give to His. We have a fairly general statement made here about this - nevertheless it is still wise to hear it.
The words good and evil are the usual words that we see in Scripture. The word "good" means something beneficial, well-pleasing to God, fruitful, morally correct, proper or convenient. The word "evil" meaning something bad in a moral and ehtical sense. The final arbiter of whether something is in either category is God and His Word.
What brings a distinction to this is the use of the word "seeks." In this passage each time it is used - it is a different Hebrew word - and that helps us to see what is going on in this passage itself. The first time this word is used it is used to speak of diligently seeking good. The word here is "shachar" in the Hebrew and it means to inquire after something or someone. Here what the person is iquiring about is what is good. This is a passionate search to know and to walk in what is good. The second time the word is used it is the Hebrew word "baqas." This means to seek something so that you can obtain it. When these two words are put together they communicate something very important to us. The wise man is the one who diligently inquires of God what is good. He wants to understand what is morally right and good - what is beneficial to others and to himself. But he or she inquires (seeks) it because he or she wants to obtain favor from God. Thus the seeking (inquiring - questioning - study - longing for knowledge) is so that they can please God and obtain His favor. There is another aspect of this that simply means by inqiring what is good morally - they also will obtain favor with others as they watch their selflessness and willingness to give of themselves.
The last time the word "seeks" is used - it is used in the context of seeking evil. The Hebrew word here is "darash" which means to seek after something by frequently going after it. It has the idea of treading a path again and again. It speaks of someone who is seeking after something by going somewhere often. Thus the idea here is that the one who is seeking evil - is choosing to tread a path to it again and again in their lives. We are told that those who do such things, evil will come to them.
King Saul is an example for us of someone who did this. Although Saul started out well - he began to seek out evil by not obeying the Lord. He tried to obey God - his way. He did not carry out God's wrath against Amalek. He decided to keep what he thought was good and use it to serve God. He did not honor God's way of sacrificing to Him. When Samuel did not come in an allotted time - Saul did God's will his way. He made the sacrifice. This led to a pathway to evil for King Saul. As he walked this path again and again it became easier to disobey than obey. His walk with God deteriorated. He soon found it easier to follow his own flesh than respond to the Spirit's leading. In time evil came to him - and he followed it. His life is a reminder that we need to seek to know and do good - rather than frequent the path to evil. What we seek is what will eventually come to us. Seek evil and evil will be ready to lead you any time you need direction. Seek good - both to know what it is and then to own it by having a heart that seeks good - and favor from God and from others will be granted to you.