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.
I know that easily comes after the course, which is a noun and might make you think it should be followed by the adjective easy, but ask yourself what was not done as easily as thought.
The answer is pass. Pass is a verb, so it is correctly modified by 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."