The original purpose of screensavers was to prevent phosphor burn-in on CRT or plasma computer monitors (hence the name).
[1] Though most modern monitors are not susceptible to this issue (with the notable exception of OLED technology, which has individual pixels vulnerable to burnout), screensaver programs are still used for other purposes.
Cathode-ray tube televisions, oscilloscopes and other devices that use CRTs are all susceptible to phosphor burn-in, as are plasma displays to some extent.
[3] Screen-saver programs were designed to help avoid these effects by automatically changing the images on the screen during periods of user inactivity.
In these applications, burn-in can be prevented by shifting the position of the display contents every few seconds, or by having a number of different images that are changed regularly.
Later CRTs were much less susceptible to burn-in than older models due to improvements in phosphor coatings, and because modern computer images are generally lower contrast than the stark green- or white-on-black text and graphics of earlier machines.
Some screensavers activate a useful background task, such as a virus scan or a volunteer computing application (such as the SETI@home project).
Decades before the first computers using this technology were invented, Robert A. Heinlein gave an example of how they might be used[1] in his novel Stranger in a Strange Land (1961):[5] Opposite his chair was a stereovision tank disguised as an aquarium; he switched it on, guppies and tetras gave way to the face of the well-known Winchell Augustus Greaves.The first screensaver was allegedly written for the original IBM PC by John Socha, best known for creating Norton Commander; he also coined the term screen saver.
In addition, the first model of the TI-30 calculator from 1976 featured a screensaver, which consisted of a decimal point running across the display after 30 seconds of inactivity.
The screensaver interfaces indirectly with the operating system to cause the physical display screen to be overlaid with one or more graphic "scenes".
The screensaver typically terminates after receiving a message from the operating system that a key has been pressed or the mouse has been moved.
If the program calls in response the standard system function (DefWindowProc), the screensaver defined in the control panel screen runs.
This enables malware authors to add ".scr" to the name of any win32 executable file, and thereby increase likelihood that users of Microsoft Windows will run it unintentionally.
Most modern computers can be set to switch the monitor into a lower power mode, blanking the screen altogether.
On older versions of Microsoft Windows the native screensaver format had the potential to install a virus when run (as a screen saver was just an ordinary application with a different extension).
Modern versions of Windows can read tags left by applications such as Internet Explorer and verify the publisher of the file, presenting a confirmation to the user.