When the Spanish Penal Procedural Law (in Spanish Ley de Enjuiciamiento Criminal, henceforth LECrim) regulates the diligences aimed to interfere with the right to the secret of the communications, it divides theses diligences in two groups, the diligences which don’t need technical means to intercept the communications, and the diligences which do need these technical means to the interception of the communications. In the former group we only find one diligence the detention and opening of the written and telegraphic correspondence, while in the former we find a broader variety, as I said, they have in common the necessity of a technical means to intercept a communication.
Despite this apparent division, the right affected by the measures of interception is the same, all damage in the same degree the right to the secret of the communications recognized in the Spanish Constitution (henceforth CE) as a fundamental right. The right to the secret of the communications is one of the most important rights a democratic country may have, it guarantees  that the public powers, mainly the judicial police, will not intercept a communication without the knowledge of those who participate in it. Indeed, the Spanish jurisprudence attaches the right to the secret of the communications to the dignity inherent to all human being, it means that without this right a person cannot develop in right conditions, it may be a slave, or even an animal, but not fully grown adult of a democratic country.
But, what is precisely the content of this fundamental right? The right to the secret of the communications comprehends different aspects of the process of communication, of course is included the right to preserve the secret of the message transmitted through the act of communication, yet we have to add other aspects of such communication process, as the identity of those who intervene in it, the date in which the communication took place, or even the proper existence of the communication. All this compound of data, information, which envelopes the communication is what is protected under the called right to the secret of the communications.
As all fundamental rights recognized is the Spanish Constitution, the right to the secret of the communications has its limits, they are other social values of general character, between them the prevention of the crime which included the investigation and the punishment of the actions committed. Therefore we need some exceptions which allow the application of this limits. I will mention first the easiest but also the less common, one of the exceptions which permits the public powers to access to a private communication is the consent of one of the parties taking part in the process of communication, for instance if the recipient of an email grants the judicial police the access to its content, there would not be an infringement of the right to the secret of the communications. Although, I suppose that this case should be very restricted in the practice. Thereby, when we talk about an exception to the right to the secret of the communications usually talk about what is explicitly stated in the CE, the judicial resolution. According to the Spanish law, the Spanish judges are endowed with the power to authorize a legitimate intromission in the right to the secret of the communication, on the contrary to other European jurisdictions where a judge is not needed, the Spanish law gives to the judges the neutral position as protectors, at this early step of the process, of the guarantees of the citizens. Thus, the judge doesn’t play the role of the accusation, he is only the “referee” of the process, who takes care that the requisites established in the law to authorize the intromission are complied. These requisites have been developed by our jurisprudence throughout the years, mainly these are three, 1) the judicial resolution has to gather the evidences which support the adoption of the measure, 2) the judicial resolution has to contain explicitly the connection between the crime investigated and the person to whom this is attributed, and 3) the judicial resolution has to gauge the fulfillment with the principle of proportionality. 
Let see with more detail each one of these requisites in order. The evidences, should be objective data in a double sense, they has to allow a third party its control, and they has to serve as the base to the inference that a crime was committed or will be committed. We say that the evidences needed are less than those need to accord the prosecution, but more than those originally possessed at the beginning of the investigation. Besides, this evidences will be in accordance with the principle of speciality, the crime authorized by the judicial resolution should be the only investigated. The principle of speciality means that the evidences gathered during the instruction of the process, which at the same time are proofs of a crime or crimes, will serve a the motive of the judicial authorization, being forbidden the investigation of other crimes not included in the original judicial authorization. But we can go even deeper, becase the Spanish jurisprudence has developed the doctrine of the casual discovery, when a crime is discovered using as a means the diligence authorizing the investigation of other crime, the evidences obtained will be legal in spite of not be included at the original judicial resolution. This evidences of other crime to that authorized, will be treated as notitia criminis, hence a new judicial resolution will be need to continue the investigation of this “new” crime, which as the original resolution should gauge if the principle of proportionality is complied. 
Now is the turn of the connection between the person investigated and affected by the measure, and the crime investigated. Such connection is necessary to preserve the right to defense of the investigated, since only through the attribution of the crime to a suspect, is possible to really gauge the fulfillment with the principle of proportionality, which is the most important of all the requisites, and which will serve later to appeal against the measure in the future by the suspect.
The principle of proportionality, is the core of the judicial resolution authorizing the intromission in the right to the secret of the communication, because through it is how we really know how necessary was this measure, and if really there wasn´t other measure less harmful to the rights of the suspect. We can decompose the principle of proportionality in three parts, first, the measure has to be right to achieve the legitimate constitutional goal followed by it, this is, the investigation of the crime (suitability trial), second, the measure should be necessary or indispensable, this is, there should not exist other measures less burdensome that, without impose any sacrifice of fundamental rights or with a lesser sacrifice, are equally apt for such goal (necessity trial), an finally, that from the application of the measure derives more benefits or advantages for the general interest than detriments over other goods or interests in conflict o, said in other way, that the sacrifice imposed to the fundamental right not turned out excessive in relation with the gravity of the facts and the suspicion existing (proportionality trial in strict sense).
Although what we have seen until this point is what have been said by our tribunals with respect the proportionality of the measure, the LECrim has copied this jurisprudence and mustered it in the art. 588 bis.a to the art. 588 bis.k. For instance, the art. 588 bis.a establishes the principle of speciality, or the art. 588 bis.c expresses the requisites of the juridicial resolution authorizing the intrusion, or the art. 588 bis.i talks about the causal discoveries. Therefore we are in front of a clear case of how the law is formed, first the practice supplies the tribunals with those cases which will serve as the basis to create jurisprudence, and later this use and practice of the tribunals will be fixed in the law.
We cannot end this writing without reinforcing the idea that, the articles contained in the art. 588.bis.a to art. 588.bis.k, only apply to all the measures aimed to interfere with the right to the secret of the communications using technological means, leaving aside the opening and detention of correspondence. There is another important consequence, this articles have to be mingled with the specific articles destined to regulate each of the diligences which follow the Chapter IV here studied.