The Electronic Communications Privacy Act of 1986 (ECPA) was enacted by Congress to prevent unauthorized government access to private electronic communications, such as phone calls, wire taps, and computer transmissions. Some states have tinkered with this statute to call for a consent provision, where the law does not apply if either one or both of the parties involved (depending on the state) consents to the government's listening in.
There are pretty significant consequences for a violation of the ECPA. Courts can hand down both civil and criminal penalties for a breach of the statute, such as monetary damages, a hefty fine, and even imprisonment (usually a maximum of five years).
In essence, the ECPA seeks to prevent and punish illegal eavesdropping, especially when the information from that eavesdropping is used in a malicious way. Someone illegally wire tapping a phone conversation and then using the information they learned in that conversation to obstruct justice, for example, would be a violation of the statute. Congress and the judiciary recognized that as technology evolved, so did methods of listening in on people's communication, either by phone, computer, or another way of transmitting data. The days of people in the US communicating primarily through telegrams and letters had ended, and Congress saw a need to address the possibility of illegal eavesdropping on communication.