Matter produces gravity.
We don't exactly know how this works because we do not have a suficiently detailed theory of gravity that covers the graininess of matter and energy in a 'quantum theory of gravity'. Anyway, gravity according to general relativity is equivalent to the geometric properties of space-time, and infact they are equal and inseparable descriptions which you are free to move between. Geodesics are geometric objects which represent the straightest possible line that can be drawn between two points, so whenever you talk about what geodesics look like, you are invoking the geometric description of gravity and not its familiar Newtonian description in terms of forces. Your question is now equivalent to asking why it is that on a flat piece of paper, a straight line is 'straight'. It is the result of the fact that the backgroud space is the way it is.