1) In many cases, when your immune system kills an invective agent, a type of chemical called a pyrogen is release by them as they die. These cause your temperature to spike, the hard your system works the higher it goes. To some degree, you are adapted to this - it is both a warning you are sick and, as any temperature
increase, speeds up chemical reaction so the immune system can work a little faster. But too high a fever can harm, even kill.
2) It is not believed that it suppresses immune function. But the precise mechanism of how it reduces a fever is still unknown.