At its broadest, an explanation is anything that answers a 'why' question. Explanations can be of many different types, depending on the subject matter, and explanations can be good, bad or indifferent. The most common kinds of explanations are scientific, and in the case of human behaviour, teleological.
Even within the realm of scientific explanation, there are also different kinds. "Why does water boil when heated?" is a request for an explanation of physical behaviour. "Why are whales mammals?" is a request for an explanation of the classification of living things. "Why does the Himalayan mountain range exist?" is a request for an explanation of a geological phenomenon. "Why do fools fall in love?" is a request for an explanation of human behaviour. Scientific explanations are often reductive in nature and seek to explain complex or macroscopic phenomena in terms of simpler or microscopic ones.
In the context of human behaviour, we often request teleological explanations. "Why did you do that?" is a request for a reason or an end or a motivation, not a request for how the nerves and muscles in a human body work. Even explanations of human actions can be of different kinds. For example, "Why did you spill your drink on the floor?" might be answered in several distinct ways. "I was curious to see how quickly it would evaporate." "Other people were doing so, and I decided to join in." "I was making a libation to the gods." "Someone jogged my arm." "I was drunk."
We also often ask for explanations of beliefs. "Why do you think that?" is normally a request for reasons or grounds for a belief. It is not a request for a causal explanation of a cognitive state. Also, we can ask for explanations of obligations. "Why should I do that?" is typically a request for an explanation of how an action fits into a moral framework or how it can be assimilated to an accepted moral paradigm.
Some explanations are better than others. To explain things by reference to a holy text is a poor quality explanation. It is only of value to devotees of the religion. A good scientific explanation has the same qualities as a good scientific theory, i.e. consistency, coherence, clarity, simplicity, comprehensiveness, lack of adhocness, fit with empirical data, consilience, testability, high predictive value, high practical value, and maybe others. An explanation that just says, "Because God says so" is adhoc and unsatisfactory.
There are some Stanford Encyclopedia entries that cover these topics in more detail. Scientific explanation. Reasons for Action. Metaphysical explanation.