I can’t see what was posted above anymore, but the DeviceCheck API lets app developers store 2 binary digits (that means 4 different states: 00, 01, 10 or 11) per device on Apple’s servers. So, no, these don’t get erased during a Factory Reset as they’re stored on Apple’s servers. But your phone will.
It was - in the ancient times. Then, there were 3rd party cookies which you had to manually approve upon the initial creation. And then it went all down south and got abused via CDNs and ad networks.