What follows is my personal view. I welcome comments.
Science
Science is, to a large extent, the use of systematic methodology to study the world. It isn't always obvious how to systematize a study, so sometimes there is a period of trial and error while scientists experiment with various ways of systematizing.
Mathematics
Mathematicians often see their discipline as the study of pattern, or of regularity or symmetry. But we could equally consider it the study of systems and systematicity.
There we see the connection. Science uses systematic methods, and mathematics studies the principles of systematicity. That makes mathematics a study of some of the underlying principles of science, albeit abstracted and idealized from what happens in reality.
Examples
Example 1: Counting is probably one of the earliest systematic methodologies used by man. The study of natural numbers is mainly a study of the principles and consequences of counting. The natural numbers are a kind of fictitious objects to which we can apply our idealized system of counting.
Example 2: Measuring of distance, length, etc depends on the systematics use of a portable measuring rod. Euclidean geometry is little more than the theoretical analysis of the consequences of measuring. In a ruler and compasses construction, the line between the tips of the compasses are, in effect, the measuring rod.
Usefulness
If the systematic method happens to work perfectly, then the mathematical properties of that system can be directly applied to what is studied, and we can expect perfect fit.
Even if the systematic method does not work perfectly, the mathematics is useful. For the mathematics tells us how the system would behave, purely on account of its systematicity, if reality did not intrude. That make it easier for us to see interesting features of reality in the failure of the mathematics to exactly match the world.
Comments
For a long time, mathematics advanced along with science, by studying the systems used within science. However, as mathematics became more independent it spent increasing energy in studying systematic methods in their own right, without depending on the origin of those systems in physics. As a consequence, mathematicians have been inventive in discovering many additional systems worthy of study.
More recently science, and most particularly physics, has been looking at the systems studied by mathematics, to see if some of those systems can be adopted for use in systematic empirical methodology.
What shall it profit a nation if it gain the whole world, yet lose its own soul.
(paraphrasing Mark 8:36)