Johannes Kepler developed three laws of planetary motion using Tycho Brahe's accurate data, with the third law, known as the harmonic law, establishing a relationship between a planet's orbital period and its distance from the sun. This law, expressed mathematically as p^2 = ka^3, allows astronomers to determine the mass of celestial bodies by studying their orbits. Newton later provided a framework explaining why Kepler's third law holds, demonstrating its significance in measuring the masses of astronomical objects.