There definitely is such setting, but I have no idea when it was introduced. S21 is an old phone (not to disparage it in any way).
Your Galaxy phone or tablet is configured by default to prevent the installation of apps from sources other than the Play Store and Galaxy Store.
https://www.samsung.com/ae/support/mobile-devices/how-to-ena...