Apple - How captive.apple.com is used by non-Apple devices?
Most hotspots implement customer interaction by using a captive portal, which is a restricted network connection in which all client HTTP requests are redirected to the provider’s web site. The web site can then prompt users to agree to the operator’s terms and conditions, enter payment information, or enter credentials to verify prior payment arrangements.
Apple hosts a landing page and makes a synthetic call to this when you join a network to test if the network is captive. Other vendors have similar portal detection hosts like www.msftncsi.com to detect captive networks, that's all.
It doesn't matter if the device you're using is a Mac, iPhone, Pixel, or Windows. The "Apple" part is only because they made it much easier for companies to offer wifi to their customers.
Apple uses captive.apple.com to detect that you are on a captive network, and once it detects this, it does some very Apple-specific actions. Google and Microsoft use the same method, except with a different url.
If any application wants to detect it is on a captive network, it can connect to any of these websites (captive.apple.com or the Google or Microsft site), check the result, and that way detect a captive network. You absolutely don't need to run on an Apple, Google or Microsoft device for this.
You can visit captive.apple.com yourself from your browser, and you will get a page with just the word "Success". The trick is that a captive network will instead return a complicated page saying "Please login to this network". So all an app has to do is download from captive.apple.com and check that the response is "Success". If not, the app knows it's on a captive network.