If we consider what the distance formula really tells you we can see the similarities. It is more than just a similar form.

The distance formula is commonly seen as:

##D = sqrt((x_1 – x_2)^2 + (y_1 – y_2)^2)##

We commonly write the as:

##c = sqrt(a^2 + b^2)##

Consider the following major points (in Euclidean geometry on a Cartesian coordinate axis):

What do you see in these formulas? Have you ever tried drawing a triangle on a Cartesian coordinate system? If so you should see that these are two formulas relating the diagonal distance on a right triangle that is composed of two component distances ##x## and ##y##.

Or we could put it another way through substitutions based on the distance definitions above. Let:

##x_1 – x_2 = pma##

##y_1 – y_2 = pmb##

(depending on if ##x_1 > x_2## or ##x_1 < x_2## and similarly for ##y##.)
Now what do you see? An equivalence.
##D = color(blue)(sqrt((pma)^2 + (pmb)^2)) = c = color(blue)(sqrt(a^2 + b^2))##
In short the distance formula is a formalization of the Pythagorean Theorem using ##x## and ##y## coordinates. In other words they are the same thing in two seemingly different contexts.