This prints true (even though we don't use equals method: correct way to compare strings)
String x = "p" + "qr";
String y = "pq" + "r";
System.out.println(x == y);
When compiler optimizes your string literals, it sees that both x and y have same value and thus you need only one string object. It's safe because String is immutable in Java.
As result, both x and y point to the same object and some little memory saved.
Name 'string pool' comes from the idea that all already defined string are stored in some 'pool' and before creating new String object compiler checks if such string is already defined.