There are many good explanations above, but I think that I can display a view a little bit different about this classic question:
Look at the below figure:

When the blue circle rotates around the black
circle the corresponding to the angle $\theta$, its
center moves $\theta(R+r)$.
If one marks contact point P in the initial position, now it is in P’ and the new contact point is at Q. All translation movement in O is traduced in a rotation of P.
if O move to O’ in a infinitesimal segment part of a line forward, P in contact point moves backward to P' the same length and Q is the new contact point
So we can show that OO’ = P’Q.
To convince the reader that this happens, let's approximate the circle by a regular polygon with thousands of sides, which tends to a exact circle, when the number of sides tends to $\infty$.
To be easy to see, let's imagine, instead of a regular polygon with a multitude of sides, a regular hexagon.

Now drop B run over point P of the hexagon until B touched the floor in B'. Some visions of the hexagon's PB side trajectory are shown in the figure in dotted segments.
Note that the backward displacement of P to P' is the arc PP', than with a big number of sites can be approximated by the hexagon side PP'. It's the same forward displacement from B to B'. Similarly, the hexagon will have shifted horizontally exactly the length of the hexagon side CC'(and also the center of regular hexagon).
So the complete rotation of the hexagon to bring point P to the same position will correspond to an equal horizontal displacement of the perimeter of the hexagon. Such reasoning can be imagined for any regular polygon, however much the number of sides, which approaches the perfect circle as much as you want.
It doesn't matter if the surface on which the circle spins is a straight line , a circle or a irregular shape. In all cases, we divide it into equal segments the same size as the adopted surface of the regular hexagon.

Let's also suppose the 2 segments make an $\alpha$ angle. We can transfer the hexagon by the size of the side, as in the previous figure and then drop the end B' in angle $\alpha$.(*)
Note that the center C of the hexagon first assumes position B, as in the previous figure, then assumes the position C'. Note that the sector ABC' is equivalent to sector AB'B'' (2 equal sides and 1 angle), so the displacement from center C (CBC') is equal to travelled distance for contact point A, though B' and B'' (AB'B'').
If movement of which makes it coincide with P, the total extent of translation of the center of the smaller circle (not affected by the rotation of the smaller circle) moves $2\pi (R+r)$. As we consider $R = nr$, this corresponds to $2\pi(n+1)r$.
This is the same distance traveled by the point of contact of the smaller circle, as we saw above. Thus, as the perimeter of the smallest circle is $2\pi r$, one can calculate how many smaller circles have been traveled in the complete translation: $2\pi (n+1)r/2\pi r = n+1$
Note that the above solution applies to the circle spinning over any closed figure. The ratio between perimeters is what counts.
(*) There is a alternative way to move is hexagon, it's not showed here, for simplicity, but it's equivalent.