The function i_s_sys_tablespaces_fill_table() is accessing the SYS_DATAFILES table by invoking dict_get_first_path().
All tablespace metadata is buffered in fil_system. There is a LRU mechanism, but that only controls the opening and closing of fil_node_t::handle.
It is much more efficient and less error-prone to access data file names by looking up the fil_space_t object rather than by essentially joining each row with an access to SYS_DATAFILES via the InnoDB internal SQL parser.
As noted in
MDEV-20802, ultimately I would like to remove the tables SYS_TABLESPACES and SYS_DATAFILES, because I do not think that they are serving any useful purpose.