Scientific theories are based on laws of nature, the regular behavior of forces, energy and substances. Laws provide partial prediction and seem never to be violated, but our knowledge of them is often incomplete. In science, these laws provide ultimate causality and our explanations can't go beyond this point.
The philosopher Carl Hempel formalized the structure of scientific explanation and the role of natural law in his Covering Law Model. This was a topic of repeated discussion in Zoo 400. In this framework, the specific initial conditions interact with one or more laws of nature (these are the explanans) to generate an event (the explanandum), the thing we want to explain. The links or bridges between the explanans themselves, and between the explanans and the explanandum form a logical, causal relationship. As with the other parts of the Covering Law Model, the bridges must be logically possible and empirically testable.
If I drop a rock (the initial conditions), gravity (the law) will cause the rock to move spontaneously toward the Earth (the event). The Covering Law Model provides a structured way to examine and test theories and hypotheses, demanding clarity and identifying circular arguments (adaptation is sometimes cast as both condition and event). "Intelligent design" fails here, and neo-Darwinian theory doesn't fare very well, either.
Evolution is a theory (actually, there are multiple theories). Fossils and living organisms are facts, and the evidence of relationships among organisms is also factual. Over time, our understanding of the laws of nature has changed, even though the rock still falls to the ground. Many natural phenomena are not fully predictable, and they also manifest emergent properties - a wave can't be predicted or described by the molecular behavior of water.
The philosopher Israel Scheffler made the point that explanation is more important than prediction - the universe isn't really very machine-like. Prediction can be a general statement describing what may happen in the future, or it can be used in hypothesis testing as an "if-then" statement. If a certain condition exists and interacts with natural law(s), then a certain outcome is predicted, even when the details are unknowable.