What causes gravity? Why is there attraction between masses? Is it due to time or space distortion?
I would say, it is rather vague to ask this "why" questions in physics when you are talking about fundamental things. We may say that gravity is a consequence of a deep symmetry of nature, called general covariance, which says that every reference frame should be equally suitable for the description of the laws of physics and it follows that the geometry of the spacetime is affected by the distribution of energy which is described by the Einstein's equations in simplest way. Particles follow straightest line called geodesic in this curved geometry. However this is actually "how" gravity works. What causes gravity may still be a vague question since gravity, as per current wisdom, is a fundamental interaction in nature. You just can not "explain" it from other simpler facts. Some recent attempts try to project it as less fundamental (like gravity is an entropic force). But that is very much controversial.
Hypothetically, Gravitons could also be attributable to why gravity exists. An explanation of gravitons would be too extensive for this answer box. You can read more on the Gravitons wiki page or google for more reference on the topic.