In German both words, selbe and gleiche, mean something like same in English. But they have a subtle difference in meaning. Take a look at this sentence:
We eat the gleiche (=same) soup, but we do not eat the selbe (=same) soup.
As you can see in the picture below, both people eat the same (gleiche) kind of soup, but they don't eat from the same (selbe) bowl of soup.