Let’s take a brief trip back to our school years and recall some lessons in mathematics and physics. Do you remember what the number π equals? And what is π squared? That’s a strange question too. Of course, it’s 9.87. And do you remember the value of the acceleration due to gravity, g? Of course, that number was drilled into our memory so thoroughly that it’s impossible to forget: 9.81 m/s². Naturally, it can vary, but for solving basic school problems, we typically used this value.
TL;DR: the old definition of the meter was based on the length of a string necessary to make a pendulum oscillate once each 2s. And since the oscillation of a pendulum depends on both gravity and π, by assigning that length the value of one unit, you end with gravity as π².
This gets easier to see if you actually include the units into the equation:
T = 2π√(l/g) // the formula for pendulum oscillation
T² = 4π²l/g // getting rid of square roots, bloody roots
g = 4π²l/T² // same junk as above, just reorganised
g = 4π²l/(2s)² // they chose a pendulum with 2s oscillation
g = π²l/s² // cancelling out 4 and 2²
g = π²(1m)/s² // "we shall call that length ONE METRE!"
g = π²m/s² // gravity is pi², and the units fit
TL;DR: the old definition of the meter was based on the length of a string necessary to make a pendulum oscillate once each 2s. And since the oscillation of a pendulum depends on both gravity and π, by assigning that length the value of one unit, you end with gravity as π².
This gets easier to see if you actually include the units into the equation: