Let $(C,x)$ be a fixed curve of genus $g \geq 1$ with one marked point and let $D\in C$ be a small disc centered at $x$. Over the punctured disc $D^*$ we have a natural family of smooth curves with two marked points, namely, to $y \in D^*$ we assign the curve $(C,x,y)$. Extend this family to a family of stable curves over $D$.
I am a beginner in the field, but I know that for a curve $(C',x',y')$ of genus $g$, the limit when x approaches y is a curve of genus $g$, just with a singular point at one place "of the torus" instead of being smooth. Can I use this fact here? If so, why (not)?
The way we typically draw such a thing is as a square mapping to a line segment (representing $\pi:D \times C \to D$) with a horizontal line somewhere across the square (the constant section $x$) and a diagonal line (the moving section $y$), so the two sections intersect at $(x,x)$ in the central fiber. The definition of stable curve requires that the marked points always be distinct, so the central fiber is not stable.
The solution is to blow up the surface $D \times C$ at $(x,x)$. This does not change any of the non-central fibers, but it changes the central fiber which is now the transverse union of $C$ and a copy of $\mathbb P^1$, with the attaching point $x \in C$. The two sections no longer meet the copy of $C$, rather they meet the $\mathbb P^1$ at distinct points. Since this copy of $\mathbb P^1$ has three distinguished points (the attaching point and the two points where it meets the sections) which must be preserved by automorphisms, there are actually no non-trivial automorphisms of $C \cup \mathbb P^1$ other than any which might be inherited from $(C,x)$ (which was assumed stable), so the central fiber is now a stable curve. And since it only has $3$ distinguished points, we can assume those points are $0,1,$ and $\infty$ and the configuration is unique up to isomorphism.
It sounds like you were asking about how the singular point arises and how to formally show that. Does this clear things up?
EDIT: One more thing worth mentioning: the only interesting behavior here happens over $x$. As such, there is no reason to restrict the base to $D$. This extends with no effort to a family over $C$.