Jamal knows the answers because each question on the show relates to a specific experience from his life - from living in the slums to working at a call center. The movie uses a flashback structure where each question triggers a memory showing how Jamal gained that knowledge through his difficult life experiences.