"For a harlot is a deep pit and an adulterous woman is a narrow well"
This is the Hebrew word zanah which means to commit fornication, harlot. The idea is clearly to be involved in sexual relations with someone other than your spouse.
This is the Hebrew word shuchah which means pit. This is the kind of pit used to trap animals so that they cannot get out.
Solomon describes the woman who is willing to have sexual relations with someone she is not married to as a deep pit. You fall into the pit but you cannot get out without help. Solomon is saying that you think you are in control when you get this "side benefit" of relations with someone who is not your spouse, but you have actually triggered a trap in which you are at the bottom of a deep pit and you cannot get out without help. You are no longer in control.
The Israelites would have been familiar with these types of traps for lions and other animals that inhabited the ancient forests. The mighty lion leapt onto the soft-looking landing, only to find that it gave way beneath him and something else was controlling him.
So many men are like this lion -- believing that they are in control and yet trapping themselves into a mess.
This is the Hebrew word nokri which means foreign or alien. Any woman who was foreign to a man was not his wife. It was a way of saying an adulterous relationship. The word usage in the Old Testament was: stay away from friendship with women who are not your wife.
A note to young people who are single. Be very careful about your deepening friendships. While some claim that it is possible to have a deep friendship with the opposite sex without it becoming physical, this is extremely rare. Therefore do not pursue a deep friendship with someone who you could not marry. That person is strange or foreign to you. If there is no possibility of your committing to marriage with a person, do not tempt yourself or them with a close friendship.
This is the Hebrew word beer which means well or pit. This is the same idea as the previous phrase, but here Solomon is talking about a well with its finished sides and water at the bottom. In both cases it is a trap and without a lot of help, you will not get out of this on your own. Think of yourself having fallen head first into a narrow well. You can't turn around and you can't get out.
Solomon is trying to say that the opportunities to cheat on your spouse may seem like a great extra benefit, but they are a trap and you will not be able to get out without help. If you go there, things you cannot control will happen that will trap you in some way. Don't go down that path no matter how alluring it looks; no matter how you think you are in control.