Why timeout a working connection?

There are many ways how a program or website can detect that the device has no connection. But it's a common practice to timeout a connection after a while, even if it is working (just slow). This leads to frustrated users who have to keep pressing the reload button manually and wastes time loading the same thing over and over on an already slow connection.

So why is this still so common? Wouldn't it be better to just keep trying (optionally showing a warning to the user after a certain while, but not stopping completely)?