I've been working through this pset as well. Here's how I understand what main is doing with respect to !=EOF:
The if condition
if (isalpha(c) || (c == '\'' && index > 0))
tests if a character is either a letter or an apostrophe (as long as the apostrophe doesn't come first as index).
The else if condition that follows
else if (index > 0)
// terminate current word
word[index] = '\0';
// update counter
terminates the current word by adding the null character because it's finding the new line character \n there. (Recall how if you had to malloc space for a char*, you would have to account for the sentinel value at the end.) If it's not a letter and it's not an apostrophe, c must indicate the end of a word, and the program responds as such.
Even though one word has ended, the loop continues since it will go through this process of individually looking at each character until it finally reaches EOF.