How is the single category page called and how does it know which posts to show?

Have a look at the following documentation, this should clear things up for you. Your list of files that make up a theme are explained here also. Including which files are used when.

https://developer.wordpress.org/themes/basics/template-hierarchy/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)