Starting from first principles and general assumptions we present a heuristic argument that shows that Newton's law of gravitation naturally arises in a theory in which space emerges through a holographic scenario. Gravity is identified with an entropic force caused by changes in the information associated with the positions of material bodies. A relativistic generalization of the presented arguments directly leads to the Einstein equations. When space is emergent even Newton's law of inertia needs to be explained. The equivalence principle auggests that it is actually the law of inertia whose origin is entropic.