Any material that is sufficiently conductive will be registered as a touch. The screen does not know if it is touched by skin or cloth or whatever, all it knows is that something conductive touched it, as it locally changes the capacitance.
The conductivity of the cloth is a function of its material, thickness, coatings, dampness, etc.
In one sense the Apple screen is detecting the cloth because it is too good, not too bad. I suspect there would be many more complaints if Apple reduced the touch sensitivity of their screens.
The software does recognize certain patterns of touch (such as multiple fingers, palms, etc.) and is programmed to react accordingly (gestures, palm rejection, etc.)
btw, the exact same effect occurs on trackpads, as it is essentially the same technology.
I find the simplest solution to the cloth activating the screen is to simply double up the thickness and make sure it is 100% dry. This is usually enough to sufficiently reduce the conductance from your finger through the cloth.