In Drupal theme folder structure, there is written:
Templates provide HTML markup and some presentation logic. Contrary to Drupal 7, in Drupal 8 template files (*.html.twig files) must be stored in the 'templates' subfolder.
In my theme, I have a styleguide folder at the root. Drupal 9 finds template files, such as mytheme/styleguide/components/10-atoms/form/input.html.twig, in this folder.
Drupal 9 will use this input.html.twig file despite it's not in the mytheme/templates folder.