Here are some excerpts from Chapter One of Francis J. Remler’s book How to Resist Temptation which may help:
"*Before all else, it is essential that we get as clear a notion as possible of the meaning of the word temptation.
Temptation is derived from the Latin tentare, which means “to try” or “to test.” Accordingly, a temptation may be said to be a trying or a testing of the soul for the purpose of ascertaining its attitude toward God and its fidelity in the service it owes to Him.*"
"*Temptations, therefore, are meant to reveal whether the love that a soul claims to have for God is genuine and true, and not mere hollow sham and vain pretense. They are the acid test of the spiritual life. It is well known that there are certain substances that look so much like gold that they are often mistaken for that precious metal by ignorant and inexperienced persons. Many a man has been deceived by the worthless substance commonly known as “fool’s gold.” To discover whether minerals that look like gold are the genuine metal, an assayer employs special tests. One of these consists in subjecting the substance to the action of strong nitric acid. If the substance is gold, the acid will have no effect on it; if it is not, it will break up and dissolve — an easy way of proving that what was thought to be gold was nothing more than worthless dross.
This has its parallel in the spiritual world. There are many souls parading before men what appears to be solid and genuine virtue. An acid test is needed to reveal the true character of these souls. This is supplied by temptations. The soul that truly loves God will not allow itself to be overcome by them, but will remain firm and immovable in the keeping of His holy law; whereas that which is only a pretender will offer but little resistance, or perhaps none at all.*"
“In the Sacred Scriptures we find two sets of passages relating to temptations that at first sight seem to contradict each other. One set appears to make God the author of temptations, while the other plainly denies this. Thus we read that “God tempted Abraham,” while we are assured by St. James that “God tempts no man.” To reconcile these two seemingly contradictory statements, we must keep in mind that there are two distinct varieties of temptations: those which are known as temptations of probation and those which go by the name of temptations of solicitation.”
“By temptations of probation we understand all those special trials to which God at times subjects persons, to prove their virtue, to prepare them for some particular work, or to elevate them to a very high degree of holiness, as was the case with Abraham, the Egyptian Joseph, Job, and Tobias in the Old Law; and with St. John the Baptist, St. Joseph, the Blessed Virgin Mary, and countless other saints in the New. Such temptations are not incitements to sin, but simply what the first meaning of the word implies: a proving or testing of a person’s virtue, as of faith, hope, patience, etc. In this sense, it is quite correct to say that God tempts man. Hence all such evils as sickness, loss of fortune, poverty, enmities, false accusations, persecutions, wars, and other calamities with which people, both the good and the bad, are often visited, can be designated as temptations sent by God, or temptations of probation.”
"*But the case is entirely different when there is question of temptations of solicitation. These are really incitements or allurements to violations of the law of God that come, directly or indirectly, from the Devil. They come from him directly by reason of the superior spiritual powers he possesses and by which he can, to a great extent, work on our imagination and senses and suggest evil to our mind. They come from him indirectly by what Sacred Scripture designates as “the flesh” and “the world,” or by what St. John more particularly calls “the lust of the flesh, the lust of the eyes, and the pride of life.” Of these means the enemy of our souls makes constant use for the purpose of enticing us to commit sin.
Temptations of this kind must never be attributed to God as their author. They are permitted by Him for the testing of our virtue and the promotion of our greater glory in Heaven; but whenever He allows Satan to tempt us, He always sets a limit to his activities. God will never allow a soul to be tempted beyond its strength and power of resistance; at the same time, He infallibly grants all the graces necessary for victory, provided the soul asks for them with humble and fervent prayer and does all in its power to refuse consent to the evil suggested*."
God did foresee the sins of Adam and Eve and knew in advance all the wiles of the Evil One. Nothing escapes His Omniscience. He gives man sufficient knowledge to exercise his free will in perfect freedom in this probationary antechamber which we call the ‘world’. Too much knowledge or too little knowledge would constrain man’s freedom. God gave Adam and Eve precisely the right amount of information about their duties towards Him. God allowed the snake to test them. And no test is worth a row of beans if the answers are supplied up front.
Hope this helps.