theming – Are twigs and .theme files in Drupal basically the equivalent of core output overrides in Joomla?

New to Drupal, used to work on Joomla. Love Drupal.

I am a bit confused about Twigs and the .theme file, the way I understand it is both are used to override the core rendering of drupal, each in a slightly different way.

Would it be safe to assume, as I’m making a first theme for Drupal 9, that Twigs and .theme files are basically what the core overrides are in Joomla, where in Joomla one would put say a “mod_menu” folder inside the template’s “html” folder and there put all the php to change how a menu is rendered in Joomla.

Is this an equivalent feature or did I miss the point of Twigs and .theme files? Or is there something more to Twigs and .themes I should know about as not to fall into a trap later on in development?

More about Joomla’s core output overrides:
https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core