Differences between country code and generic code

Transifex has a large number of language codes, and sometimes, users just get lost on which language should be used. What are the advantages and disadvantages of using the country language code versus generic language code, and what should the user take into consideration when adding language codes to a project?