Scratch org definitions come from JSON text files that are stored in your project's repository and directory structure. When an SFDX project is first created, it comes with a
config/project-scratch-def.json file that defines an extremely basic org "shape" for an empty scratch org.
That default scratch org likely looks nothing like your production org. You can use it for developing functionality that isn't dependent on your org's settings, or you can customize it using the settings that are available as part of the configuration file, or you can script your process to perform Metadata API deploys or other API actions to control settings that DX does not support yet.
Ideally, the combination of your DX source code (including all your programmatic and declarative customization) with your scratch org definition gets you close enough to Prod not to matter.
However, it's possible that isn't enough to get the scratch orgs looking close enough to Prod for your testing to be meaningful. If that's what you need, you should be looking at the Org Shape pilot, an unreleased feature allowing you to create org shape snapshots from real, existing orgs and build scratch orgs on that basis.