In addition to the ordinary mark ring that belongs to each buffer, Emacs has a single global mark ring. Each time you set a mark, in any buffer, this is recorded in the global mark ring in addition to the current buffer's own mark ring.
The command C-x C-<SPC> (pop-global-mark) jumps to
the buffer and position of the latest entry in the global ring. It also
rotates the ring, so that successive uses of C-x C-<SPC> take
you to earlier buffers and mark positions.