Where does KiCad look for images.tar.gz?

Looking at the source code

here

static const wxString IMAGE_ARCHIVE = wxT( "images.tar.gz" );

here

wxFileName path( PATHS::GetStockDataPath() + wxT( "/resources" ), IMAGE_ARCHIVE );

here

wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
{
  /* ... */
  if( aRespectRunFromBuildDir && wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
  /* ... */
  else if( wxGetEnv( wxT( "KICAD_STOCK_DATA_HOME" ), &path ) && !path.IsEmpty() )
  /* ... */
}

Therefore, KICad looks for images.tar.gz in ./resources directory if KICAD_RUN_FROM_BUILD_DIR is set.

On the other hand, if KICAD_RUN_FROM_BUILD_DIR is not set, KICad looks for images.tar.gz in KICAD_STOCK_DATA_HOME, which defaults to /usr/local/share/kicad/resources.