P2 is Matter over Thread
It needs a compatible Matter controller and Thread border router. It does not pair as a normal Zigbee child device simply because Aqara is the brand.
P1 is Aqara Zigbee
It is the cleaner fit when an existing compatible Aqara hub and Aqara Home automations already solve the task.
Choose the network you already operate well
Native Matter sharing can broaden ecosystem options, while Zigbee can keep an established Aqara setup simpler. Count required controllers before comparing sensor price.
Physical installation still decides reliability
Compare dimensions, magnet gap, battery access, clearance, and mounting surfaces for the exact door or window.