In the sentence: He did not pass the course as easily as he thought he would.
Why is easily (an adverb) used?
Why is easy (adjective) not correct?
Adjectives modify (describe) nouns and pronouns. Adverbs modify verbs, adjectives and other adverbs.
The course was not easy.
course, easy: "course" is a noun, so we use an adjective.
He thought he would pass it easily.
He did not pass it easily.
He did not pass the course as easily as he thought he would.
pass, easily: "pass" here is a verb, so we use an adverb.
It directly modifies the verb pass, hence it should be an adverb. It is not modifying a noun.
On a similar note though, modern speakers are notoriously bad at using adjectives where adverbs would be better. Undoubtedly you hear people use adjectives in a similar functional role often. Technically it is not good grammar.
"He did not easily pass the course as he thought he would," is a positive statement. The construction above is a pseudo comparative form. It compares what he thought would happen to what actually happened. This makes the grammar somewhat confusing. A more simple and direct statement would be: "The course was harder for him than he thought it would be."