Stress on words like "academy" has historically been somewhat variable. We see two conflicting tendencies: one favoring stressing the first (fourth-to-last) syllable, and one favoring stressing the third-to-last syllable. It's not quite clear why, but the third-to-last pronunciation won out.
You can see references to the other pronunciation in Nares (1784) and Elphinston (1786). A similar variation exists today for the word "antimony"—Americans usually pronounce it with stress on the first, and Brits on the second syllable.
"Academic" is easier to explain, at least one one level. As John Lawler mentioned in the comments, there is a strong tendency towards pronouncing words containing the suffix "-ic" with the stress on the immediately preceding syllable (and a slightly weaker, but still strong tendency to shorten any vowel but "long u" in this position). I describe the only exceptions I know of in the following answer: Words pronounced with stress patterns like in "politics", "lunatics", etc.?
However, explaining the origin of this tendency/rule is difficult.