A rain droplet functions both as a mirror and prism.
As the first, primary, rainbow is caused by refraction and reflection of sunlight within rain drops, the secundary rainbow will show up when sunlight is reflected twice within the droplet. This also explains the reason why we see the reversed order of the colors. Because of the extra reflection and thus light gets lost, we see the secundary rainbow less bright than the primary rainbow.
Another phenomenon is the area between the primary and secundary rainbow. This area is typical darker and called Alexander's band or Alexander's dark band. This optical phenomenon was the first time described by Alexander of Aphrodisias, 200AD.