Buzzer on a computer mainboard
A little bit of history about the second point: Original PC didn't have a sound card and there were no complicated speaker systems we have today. Instead it only had a single weak small speaker to provide sound and was called "PC speaker". The output was created by programming the Intel 8253 Programmable Interrupt Timer. It's counter 2 was connected to the speaker and could be used to play music or in some games made by high sourcerors familiar with the esoteric secrets of Black Magic even produce speech. 

Over time sound cards appeared that could produce more complex sounds and that lead to use of external speakers with PC. As those speakers evolved, the PC speaker degenerated. Today, it's usually just a buzzer and isn't as supported in operating systems as it used to be. For example, Windows 98 could use PC speaker on some computers as a normal sound output for all audio events, while new versions of Windows can only beep. The only remaining use of it seems to be to notify user of some low level problem which prevents computer from booting normally.