The Accusatory Principle in Spanish Law
The accusatory principle is a fundamental element in a Rule of Law according to which a defendant cannot be convicted in a trial for something other than what he has been accused of. In this way, the judge is unable to, ex officio, search or inquire into the criminality of the facts prosecuted, and can only limit himself to "listening" to both parties and making a decision that is as objective as possible.
In Spain, it specifically emanates from article 24 of the Spanish Constitution and it derives from the fundamental right of effective legal protection and the fundamental right to a due process.
This principle prevents the Administration of Justice, the Judicial Power in the State, from being used in an interested and manipulated way at the whim of the powerful and influential, giving rise to abuses of power. Otherwise, if a defendant is accused of certain crimes, a "bought/manipulated" judge could sentence her/him for something different, which would lead to abuse, defenselessness, etc.
These series of guarantees, along with other fundamental rights, are the heart of the judicial system, which protects citizens, prevents abuse and manipulation, and creates the foundations for a healthy coexistence.