This is a video explanation of max pain. It describes how max pain can be used to predict the stock price upon option expiration. In brief, max pain functions because of the hedge re-balancing by the market maker who wrote/ sold the option contracts. For a more detailed explanation, please watch the video below or see the various blog posts on this topic.
Max Pain Video