In the early 17th century, the mainstream view of motion was that objects of different weights fall at different velocities. This view was based on Aristotle's idea that heavier objects fall faster because they have a greater "natural tendency" to move towards the Earth center.
When Galileo deduced a contradictory conclusion from Aristotle's theory, he thought that this view, which had ruled for 2000 years, might be wrong. In one of his thought experiment, a heavy object and a light object are tied together to be dropped at the same time, the heavy one is slowed down by the lighter one. However, they are combined together to achieve more weight, making them fall faster according to Aristotle's view.
Galileo challenged this view through a series of experiments. He dropped balls of different weights from the top of the Leaning Tower of Pisa. Contrary to the prevailing view, he observed that all balls reached the ground at the same time, regardless of their weight. (Many historians believe that Galileo did not actually perform this experiment and it was likely just a thought experiment.)
The ramp experiment was the one he actually had done. Galileo believed that natural laws followed the simplest principle, so he hypothesized that the velocity of an falling object might be uniformly changing, i.e. v=kt or v=ks. This seems to be a very simple job today, but the concept of displacement, velocity, acceleration was very vague in Galileo's time. If the velocity were proportional to displacement, a ridiculous conclusion would be drawn. Ultimately, he believed that the velocity of falling object is proportional to time. As the velocity was difficult to measure directly at that time, Galileo converted v=kt into a formula of displacement and time, namely x=kt². The time could not be accurately measured due to the fast falling object, so he also designed a ramp experiment to slow down the effect of gravity.
Galileo prepared a ramp and let a ball roll down from the top. He used his own pulse to determine the time interval and recorded the distance the ball traveled, x₁, x₂, x₃, x₄. He found that the distances were proportional to the square of certain numbers, i.e. x₁:x₂:x₃:x₄=1:4:9:16. Moreover, the time it took for the ball to reach ramp bottom was independent of the ball's weight. The steeper the ramp, the short time. When the angle was the same, all the balls reached the bottom at the same time.
Then Galileo did a thought experiment to relate the ramp and free fall. When the ramp was vertical to the ground, the ball was actually falling freely due to gravity. The time it took for the ball to reach the ground was independent of its weight, which means that all balls fell at the same velocity.
Galileo's study of motion not only established many basic concepts for describing motion but also created a set of scientific methods that were extremely beneficial for the development of modern science. The core of this method is to combine the experimentation, logical reasoning, and mathematical calculation harmoniously for the study of physics.