How is .app file compiled in Xcode is different from one that is installed via installer

I see difference in .app compiled in Xcode and then Copied to applications and the one installed by creating with packages app. In Catalina I see extra user consents coming trying to access Documents. When installed I don’t see these user consents Want to understand the difference between compiled app in developer environment and the one installed