It's essentially a means of expressing something that you don't know to be true. The only phrases we have in English are the conditional subjunctive, such that:
If I were in the office, I would have signed for the package. <- Subjunctive. I wasn't there.
If I was in the office, I certainly signed for the package. <- Not subjunctive. I may have been in the office or I may not have been.
Spanish is different from English. Rather than using the subjunctive for counterfactual situations, Spanish uses it for uncertainty. So, if you're going to express uncertainty, you use the subjunctive (if I use words wrong it's because I haven't used Spanish in about 12 years):
Dudo que él tenga el libro. I doubt that he has the book. (Expresses doubt)
No dudo que él tiene el libro. I don't doubt that he has the book. (No doubt, no subjunctive)
Espero que ella venga a la fiesta. I hope that she's coming to the party. (Expresses uncertainty)
Creo que ella viene a la fiesta. I believe that she's coming to the party (Expresses lack of uncertainty)
You will of course already have encountered the subjunctive in the form of the so-called "polite imperatives", which are subjunctive forms. You can also find them in indirect imperatives, such as:
!Que te jodas! (not going to bother inverting the exclamation mark - too much trouble) Go fuck yourself! (indirect imperative)
!Jodete! Fuck yourself! (direct imperative)
For the record, I've heard the former but not the latter. Also, the "o" needs an accent in the last example, but since the two modified Latin keyboards I use, German and French, don't have the acute accent on anything other than the "e", I'm too lazy to put it in through cut and paste).
It is used everywhere, it is used all the time and you need to know it. It conjugates differently, e.g.:
Present:
voy, vas, va, vamos, vais, van
vaya, vayas, vaya, vayamos, vayais, vayan
tengo, tienes, tiene, tenemos, teneis, tienen
tenga, tengas, tenga, tengamos, tengais, tengan
Imperfect:
iba, ibas, iba, ibamos, ibais, iban
fuera, fueras, fuera, fueramos, fuerais, fueran
tenia, tenias, tenia, teniamos, teniais, tenian
tuviera, tuvieras, tuviera, tuvieramos, tuvierais, tuvieran
etc.
Edit: thanks to Legolas for pointing out that I was using the Italian article for "libro". I just automatically think il libro, i libri.
ἡ δὲ κἀκ τριῶν τρυπημάτων ἐργαζομένη ἐνεκάλει τῇ φύσει, δυσφορουμένη, ὅτι δὴ μὴ καὶ τοὺς τιτθοὺς αὐτῇ εὐρύτερον ἢ νῦν εἰσι τρυπώη, ὅπως καὶ ἄλλην ἐνταῦθα μίξιν ἐπιτεχνᾶσθαι δυνατὴ εἴη. – Procopius
Ummaka qinnassa nīk!
*MySmiley*