Does autoexec.cfg run by itself, or do I need to type something in game?
It runs by itself: Source 2 executes the autoexec.cfg file automatically every time CS2 launches, as long as it is saved in the game's cfg folder; there is no need to type exec autoexec or pass a launch parameter.
Why does rate only accept four fixed values?
Because rate sets the ceiling of bytes per second the client requests from the server, and the generator limits it to the four brackets historically used across CS:GO and CS2, 196608, 393216, 786432 and 1000000; any other number is replaced with the 786432 default to avoid an invalid value in the file.
What does host_writeconfig at the end of the file do?
It forces the engine to immediately write every current cvar to config.cfg, without waiting for the player to close the game normally; without it, a crash or a forced close after changing settings can lose whatever was not yet saved to disk.
Does setting m_rawinput to 1 change how the mouse feels?
Yes: with m_rawinput at 1 the game reads movement straight from the mouse driver, with no acceleration or smoothing applied on top by Windows, which is the recommended default for keeping the same physical sensitivity across any PC.