A non-Jew does a melacha for himself, a Jew may benefit on shabbos.
A non-Jew asks to borrow a book from a Jew. The Jew fumbles around in a dark room looking for the book, and the non Jew turns on the light.
The non-Jew did the melacha for the Jew, but really he did it for himself so that the Jew can find the book faster.
Background info: There are 2 possible prohibitions that can exist separately: Asking and benefitting. At the end of this article are mnemonics for when amira laakum is permitted. http://www.theyeshivaworld.com/news/headlines-breaking-stories/483672/the-laws-of-amirah-lakum-the-shabbos-goy.html