When a person accused of a crime hires a defense attorney, every communication between the defendant and his or her attorney is privileged communication, meaning anything the accused tells the attorney cannot be divulged by the attorney nor can the attorney be forced to give up information the client has revealed. With certain exceptions, this also applies to communications between a potential client and an attorney, such as a consultation with an attorney before deciding whether to hire the attorney.
The purpose for this privilege is self-evident: If the client is not able to freely speak to his or her attorney, the attorney may be hindered in providing an effective legal defense. Although not a constitutional doctrine, the privilege implicates the constitutional protections of the Fifth Amendment (right against self-incrimination) and Sixth Amendment (right to legal counsel). As such, the privilege is one of the oldest recognized confidential communication privileges.
Imagine if this privilege did not exist and the prosecution or law enforcement could be free to learn the details of communications between an attorney and client, whether surreptitiously or by force. Clients would rightfully be concerned about telling their attorney everything and the attorney could have a serious disadvantage defending such a client. That is why, with few exceptions, law enforcement cannot listen in on conversations a client has with his or her attorney and cannot subpoena— or otherwise legally force— information a client has given his or her attorney.