Controller methods can inject properties if it is type-hinted correctly:
Post $post for single post page
Term $term and PostCollection $posts for archive page
User $author and PostCollection $posts for author archive page
Blog $blog
The resolvers take care of validating the controller callable and its arguments. In case of a problem, it throws an exception with a nice message explaining the problem.
This is also relevant to handle 404 error : see the guide Better error pages