Praise be to Allah.
What is usually the case is that wet impurity (najaasah) spreads, whether it comes into contact with something that is wet or dry.
Shaykh Saalih al-Fawzaan (may Allah preserve him) said:
If a person touches a wet impurity (najaasah), he must wash whatever came in contact with it of his body, because the impurity was transferred to him. As for dry impurity, there is no need to wash the part of the body that touched it, because it is not transmitted to him.
End quote from al-Muntaqa min Fataawa al-Fawzaan (48/18)
If the underwear became impure, the way in which it came into contact with the trousers is one of two ways:
Either this impurity was transferred to the trousers, and can be seen clearly, so the trousers became impure thereby;
Or no trace of impurity can be seen, in which case:
If the impurity is slight and there is no visible trace of it on the item with which it came into contact, then that item is not deemed to have become impure.
But if it is clearly visible and wet, then what is most likely to be the case is that the impurity was transferred to the item with which it came into contact, and the item became impure as a result.
Shaykh Ibn Baaz (may Allah have mercy on him) was asked:
Sometimes my little son’s garment is wet with impurity, then his garment comes into contact inadvertently with the garment of his older brother or with my garment, but traces of wetness do not appear on the garment of the older child as a result of this contact. Does the older child have to wash his garment in order to purify it, or is it not regarded as impure because there are no visible traces of wetness on it?
The urine of a small child is impure in all cases; from the time he is born until the end of his life it is impure, but in infancy, when he is not yet eating solid food, the impurity is slight, and it is sufficient to sprinkle it with water (in order to remove the impurity), until the child begins to eat solid food. If the child’s garment is wet with impurity, then it touches another garment that is pure, this wetness makes the garment with which it comes into contact impure (najis), if it is wet. But if it was merely damp and did not leave any trace on the garment with which it came into contact, then there is no problem and it does not become impure.
But if it is clearly and visibly wet, it will inevitably have an impact on the garment with which it comes into contact, even if that does not appear in a clear manner. So whatever of this wetness got onto the other, pure garment should be washed; it should be sought out and washed with water. End quote.
In the answer to question no. 196037 we noted that there is no differentiation between impurity that is visible and that which is not visible, so long as it is known to have come into contact with the place or any of its characteristics are apparent.
And Allah knows best.