As we all know, in a plane, there is only one straight line through two points. But on a cylinder, there are countless helixes passing through two points. Why is that?
The "straightness" of a curve is a local property, determined by what happens near each point. A curve is straight if it's straight at each of its points. There "straightness" is determined by minimizing length. At each point there's a straight line that starts out in any direction.
Asking about straight lines that join two points is a global question. The answer may depend on the global topology of the surface and the location of the particular points. For example, on the sphere there are two "straight lines" joining any pair of nonantipodal points. There are infinitely many joining the North and South poles.
Among the straight lines joining two points you can search for a geodesic: a line of minimal length. It may or may not be unique. For nonantipodal points on the sphere it is, for a pair of poles it's not.