This is a drain pipe next to the water heater in the attic. There are several pipes going into it: TPR, drain pan, thermal expansion valve and one other that comes off the cold water and has a valve.
The PVC looks like 4 inch pipe and narrows to 2 inch pipe in about a 5 inch length. I do not know where the 2 inch pipe terminates (not outside).
Three of the four pipes terminates just inside this “bowl” and the one with a valve appears to run inside the 2 inch pipe to destinations unknown.
Whew, there I said it all, now… What the heck is it? It is full of debris and when I opened the TPR, it filled up. I stopped and it slowly drained down to about 2 inches of standing water.
If I was to take a wild guess being you stated it was in the attic you are probally viewing a drain line tapped into a vent stack and hopefully the water you are viewing is the water in a P-trap to prevent sewer gas into the attic.
I would much prefer to have the drains on a safety pan and the TPR discharging into a drain in the attic than on to the dry wall ceiling below.
SOP’s in this State does not require operating the TPR and I do not as too many of these valves will not reset and then you have a terrible mess to explain.