How exactly String Pool Works in Java?

Let me deep dive in to make you understand back story.