Newton’s second law says that:
\begin{equation} F = ma \end{equation}
where F is a force, m is the inertial mass, and a is the acceleration that the object feels. The inertial mass is a measure of how difficult something is to move.
If F is the gravitational force, we have:
\begin{equation} F_{g} = m_{g}g \end{equation}
where mg is the gravitational mass and g is the gravitational acceleration.
The equivalence principle says that we can set these two equal to each other:
\begin{equation} ma = m_{g}g \end{equation}
We can see that there is an m on both sides of the equals sign. If the inertial mass is the same as the gravitational mass, then we can cancel the m on both sides. Doing so shows that for all objects, regardless of their mass: a = g, the acceleration will be 9.8 m/s2, just as Galileo found in his laboratory.
This only works because gravitational mass, mg, is the same as inertial mass, m. Gravitational mass is related to the force exerted by gravity; inertial mass is determined by the acceleration of an object when a given amount of force is applied to it. There is no reason these two definitions of mass must yield the same result, but as far as we can tell experimentally, they are the same in our universe.