The AdS/CFT correspondence is a duality between a theory of quantum gravity on (asymptotically) Anti de Sitter (AdS) spacetime and a conformal field theory (CFT) without gravity in one lower spacetime dimension. AdS/CFT has given us a window into the nature of quantum gravity. In particular, the Ryu-Takayanagi (RT) formula, relating the entanglement entropies in the CFT with areas of minimal-area surfaces in AdS, suggests that spacetime geometry on the AdS side emerges as a representation of the entanglement structure in the CFT. We will argue that any asymptotically AdS spacetime which computes the entanglement entropies of a CFT state with the RT formula must necessarily satisfy the fully non-linear Einstein equation, thus showing that gravitational dynamics also emerges from the structure of entanglement in the dual CFT. Our results also shed some light on the RT formula and suggest that it is a natural consequence of matching between a certain bulk and boundary "algebraic" symmetry called modular flow.