The first author typically does most of the work and usually writes the paper, although I have heard that many PIs do this themselves. The last author is typically the corresponding author, which is the most prestigious and belongs to the professor who paid and conceived the project. The rest are listed by order of contribution. How does one become listed as AN author? that really depends on the corresponding author and whether he/she allows you to be listed.
I know some journals ask for a description of what each author contributed to avoid any unethical "author" additions. But this is not the norm from what I know.