These electrical boxes allow you to mount switches and connectors on your wall. Some are designed to be installed while the walls are open, and others can be retrofitted, or "cut in" to an existing wall.
Some are rated to handle AC high voltage wiring. Others are not, and are used for low voltage audio, video, and control wiring. A few are designed, or can be configured to safely handle both types of wiring.