There are 2 moods in Spanish: the indicative, and the subjunctive.
The indicative is used for anything that is concrete/ factual. For example: "Max habla español" (Max speaks Spanish). This is a fact as Max speaks Spanish, and can be proven. The speaker has spoken to Max and knows he speaks Spanish.
The subjunctive is used when there is a Desire, Doubt, Wish, Conjecture or Possibility. It is used when you are talking about something subjective/or possible, but not certain. For example: "Es posible que Max hable español" (It is possible that Max speaks Spanish). There is doubt in this sentence as the speaker is unsure if Max speaks Spanish or not. Maybe he does not know Max and therefore cannot say whether he speaks Spanish or not. In this example you use the subjunctive as you are unsure, there is doubt, whether Max speaks Spanish or not.