When you look at an image of the Mandlbrot set it shows a region of the complex plane. The starting ones usually run from $-2$ to $\frac 12$ on the real axis or so and from $-2i$ to $2i$ or so on the imaginary axis. For each point in the region (at the desired grid spacing) we take the value $c$ and see if the iteration stays bounded. We then plot at $c$ black if it does stay bounded and a color that represents how quickly it goes to infinity if it does not. So for $c=1$ the iteration gives $1, 2, 5$ and we know if it ever gets bigger than $2$ it diverges, so we quit here and plot the color for 2 or 3 iterations. For $c=i$ we get $i,-1+i,-i, -1+i, $ etc and it stays bounded, so we plot black.