Understanding Large Language Models: Mechanics, Applications, and Limitations