In Spanish, the subjunctive mood is used to communicate meanings which are subjective or less certain than the indicative mood.
The indicative mood is used to express certainty and objectivity; whereas the subjunctive mood expresses doubt, hopes, fears and uncertainty etc.
Example:
I doubt that he will go to the beach.
Dudo que vaya a la playa.
I hope Julie will return soon.
Espero que Julia vuelva pronto.