>Why will the newline be appended at the end of the string? Isn't there any mechanism to ensure that the fgets() function doesn't do this, short of writing a method to remove it myself?

Salem mentioned one reason: long lines.

If the buffer you give to fgets() is not big enough to hold the entire line, there will not be a newline at the end, and the application can call fgets() again to get the rest of the line (or do whatever the application wants to do in this case--abort, discard the line, etc.).

If fgets() automatically removed the newline, then the application wouldn't have the option to handle this situation. (Note: gets() automatically removes the newline character because it always reads an entire line up to the newline character, even if the text overflows the user-provided buffer and overwrites something else that it shouldn't, which is why it's been removed from the latest C standards.)