It is simple. paths in PATH are not considered as the first option for finding libraries. see here for more details. https://docs.microsoft.com/zh-cn/windows/win32/dlls/dynamic-link-library-search-order 23
If you want to see which dll is loaded at runtime, you can refer to the output window of VS or using sth like Process Monitor.