Mathematicspredict one situation by comparing it with others which are like it. Mathematics helps this by finding ways of understanding many different situations at the same time. The simplest example of this is numbers:
In the real world two apples plus two apples makes four apples, two bricks plus two bricks makes four bricks so in mathematics this becomes the general statement "two plus two equals four".
Another very simple example comes from set theory. If all blackbirds are black and this bird is not black it is not a blackbird. If all snow is white and this is not white it is not snow. In maths this becomes a simple principle of set theory: if A is a subset of B then "not B" implies "not A". By finding a general way to say something mathematics has solved many things at the same time. Although the case of snow and blackbirds may be easy in more complicated situations expressing things in general terms can make them much easier to understand. Sometimes mathematics goes beyond studying things which apply to many situations and studies rules which have not yet been found in the real world. Often if the rules are chosen because they are simple, later on they are found in the real world and their study proves useful.
Mathematical prediction is the basis of hard science, which relies almost entirely on equations to predict events in physics. The philosophy of science explores this. However, creating mathematics is clearly a human science. The philosophy of mathematics explores these issues, and others regarding how mathematics fits into philosophy, ethics and real life.
See also: list of mathematics topics