The Harry Potter series had 7 books to adapt, and while some weren't great (OoTP), all of them were at the very least good films. They are also all considered by fans to be pretty good adaptations of the books. Some included less than others, but nearly nothing was changed too much.
Other series based on successful book series' such as Percy Jackson and Maze Runner, changed nearly everything about the books they were based on, and as a result they suffered critically and financially. Why did studios choose to do this? Wouldn't the success of the Harry Potter films show that a close adaptation would bring success?