Achievements can have many purposes in a game.
At GDC 2010, Bruce Philips from Microsoft showed how he used Xbox Live achievements to evaluate progression and campaign completion in a dozen FPS. These achievements already existed, and were determined by the game designers, yet provided very useful for analytics.
Traditionally, achievements are binary: you have unlocked it, or you haven't. You can treat achievements as milestones that the player reached. Milestone achievements include: FPS campaign milestones or Forza 4's "import data from Forza 3".
Achievements can also take several levels. For example, Clash of Clans' Release the Beasts achievement takes 4 values: 0 when you start, 1 when you unlock Archer, 2 when you unlock Wall breaker, and 3 when you unlock Dragon. This achievement, by itself, suffices to segment the player base into new, intermediate, advanced, and expert players. It's a double-win: players have more achievements to go for, and you get a better picture than with a binary achievement.
An achievement can keep counting even after it's been unlocked; for example, Clash of Clans' Gold Grab has 3 steps (4 values) but keeps track of the gold you looted. That way, achievements can also be numerical, not just binary or Likert-like.
Achievements can be even more complex and hold metadata such as when you unlocked it, how many days it took you to unlock it, after how many tries, in how much time, and so on. With this metadata, you can label player behavior more precisely. For example, a Clash of Clans player may unlock Gold grab 3 after 3 months where another would only take one month. The later certainly plays much more (number of sessions, session length) than the former.
Achievements provide long-term goals to the player. Moreover, they can be made so the player always has a near-complete achievement in sight. For example, you reach 490/500 mortars destroyed in Clash of Clans' Mortar Mauler achievement. You play another hour to destroy 10 mortars and get the 10 gems, but by then, another achievement has reached near-completion too, and you could play another hour.
Retention achievements don't always involve grinding. They can encourage the player to explore the design space.
For skill (or luck)
For example, in FTL Repair back to full health with only 1 HP remaining. Skilled players can risk it, for the thrill. But other players can also wait for it to happen by itself.
Other FTL examples include completing a mission in less than X minutes, or not using any weapon until sector 5. Or even taking 5 turns in a row in the card game Ascension.