According to my understanding, you faced the following situation:
When you access SharePoint Sites through IE browser on the SharePoint Server, the system will prompt you to perform 3 times authentication, and then you will receive the "HTTP 401.1-Unauthorized: Login failed" error. But SharePoint Sites can be accessed normally on the WFE Server.
This is because the "local loopback check" only permits NT Authentication to the localhost address for defined hostnames.
Please run the following PowerShell in the SharePoint Management Shell to disable Loopback Check:
New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name “DisableLoopbackCheck” -value “1” -PropertyType dword
You could refer to this article SharePoint 2013: Disable Loopback Check
Thanks,
Echo Du
----------
If the response is helpful, please click "Accept Answer" and upvote it