The motivation for defining them was to study the relationships between ratios of the sides of a triangle. This pattern of defining a mathematical object can be seen throughout all fields of math. This often gives a property we can refer to when talking about a specific object. For example, when talking about circles, pi will tend to show up a lot.
Many times there will be some motivation for a definition to appear. Take the case of pi. If you divide a circles circumference by it’s diameter, you will get pi. It does not matter how small or how big the circle is. The value of pi remains the same. This allows us to talk about pi in the context of arbitrary circles.
Other times, there is some underlying notion we want to formalise. Take the example of a limit in calculus. The notion of something being very close to something else yet not being the same can be formalised by the famous(infamous?) epsilon delta definition.