The mathematics of a geodesic is an arc that remains constant as the point moves along it. In differential geometry, this can be used to describe lines in curved spaces because there will always remain two parallel tangent vectors at any given time no matter how far apart they are placed from each other on said curve. If we have our connection defined by an affine transformation acting upon metric tensor terms then these shortest paths would become pruned away due to Levi-Civita warping effects until only those curves remained without being distorted beyond recognition thanks keep everything straight compared with Euclidean space outside its influence. The curves formed between these light beams were known to Johannes Kepler since his days long before the advent of General Relativity. His third law derived from earlier elliptical planetary motion approximations could be seen as generalized into the observation that all planets had orbits described by geodesics thanks to Newtonian gravitational attraction effects.
The equations which describe how a geodesic works were derived by Albert Einstein in 1912 as part of his early investigations into gravity. The simple idea is that space-time has to be warped, or curved, to accommodate any presence of energy density regardless of how fantastically small it might be to create something like atomic structures where subatomic particles orbit one another at the speed of light. In the absence of mass effects, a pair of straight lines will always remain straight no matter what curve it cuts across to maintain its simplicity. To get around this issue, Einstein assumed that the Universe itself was inherently curved and that light beams bent once they passed by massive objects because their space was warped due to their energy density in contrast with their surroundings. Because of the curvature, light beams would always bend towards each other due to how much it weighed in comparison with its surroundings.