Calculate a distance from an address

Hi, We tried to calculate a distance in km between 2 adresses in a searbox.
When I make a test in Google Maps I get a different distance.
Could someone tell me how the estimate is done ?
Thank you

It’s a straight line between two geographical points.

You’re probably looking at driving distance.