From GNU sed manual - How sed Works
sed operates by performing the following cycle on each line of input: first, sed reads one line from the input stream, removes any trailing newline, and places it in the pattern space. Then commands are executed; each command can have an address associated to it: addresses are a kind of condition code, and a command is only executed if the condition is verified before the command is to be executed.
When the end of the script is reached, unless the -n option is in use, the contents of pattern space are printed out to the output stream, adding back the trailing newline if it was removed. Then the next cycle starts for the next input line.
From POSIX spec (thanks steeldriver for the link)
In default operation, sed cyclically shall append a line of input, less its terminating newline, into the pattern space. Normally the pattern space will be empty, unless a D command terminated the last cycle. The sed utility shall then apply in sequence all commands whose addresses select that pattern space, and at the end of the script copy the pattern space to standard output (except when -n is specified) and delete the pattern space. Whenever the pattern space is written to standard output or a named file, sed shall immediately follow it with a newline.
tl;dr the input record separator (which is newline by default) is removed before executing the commands and then added back while printing the record
There are, however, cases where the newline character can be manipulated. Some examples given below:
$ # this would still not allow newline of second line to be manipulated
$ seq 5 | sed 'N; s/\n/ : /'
1 : 2
3 : 4
$ # here ASCII NUL is input record separator, so newline can be freely changed
$ seq 5 | sed -z 's/\n/ : /g'
1 : 2 : 3 : 4 : 5 :
$ # default newline separator, so NUL character can be changed
$ printf 'foo\0baz\0xyz\0' | sed 's/\x0/-/g'
$ # NUL character is separator, so it cannot be changed now
$ printf 'foo\0baz\0xyz\0' | sed -z 's/\x0/-/g' | cat -A