Quoted from the book Introductory functional Analysis by Erwin Kreyszig :
1.6-2 Theorem (Completion). For a metric space $X = (X, d)$ there exists a complete metric space $\bar{X}=(\bar{X}, \bar{d})$ which has a subspace $W$ that is isometric with $X$ and is dense in $\bar{X}$. This space $\bar{X}$ is unique except for isometrics, that is, if $\bar{X'}$ is any complete metric space having a dense subspace $W'$ isometric with $X$, then $\bar{X'}$ and $\bar{X}$ are isometric.
Why $W$ must be a dense subset of $\bar{X}$? Is it just because generalization is from completion of $\mathbb{Q}$ (to $\mathbb{R}$) or being dense is something to do with a super-space to be complete? And if so, why?
Edit - For example (0,1) is not a complete space but its closure [0,1] is. And still (0,1) is not dense in [0,1] because int((0,1)) is not empty set.