I encounter from time to time SEO companies advertisment. When I visit their site, they usually ask me for the domain name and the keyword I would like to optimize so it appear in the search engines.

Upon entering this information, they calculate a price: e.g. $30/keyword1/yoursiteurl/month is the price to get you in the first 5 results of google for keyword1 search and to keep you there.

And now the questions:
What exactly are they doing in order to reach that?
Are they always able to do that, no matter of the keyword?
How do they manage (they do?) to get you up in a short time?
What are they doing after you already ranked well? I mean what do they have to do for the subscription money you pay further on?