Hi a warm welcome to the site.The EYFS (if you work in england) is built on legislation.
Setting's use the EYFS framework to write/inform their policies and procedures.
If you read
page 88+ of this level 3 handbook it goes into detail about how schools and early years are places where children spend a considerable amount of time and the duty that professionals have in making sure that time is spent in environments that are safe and nurturing. Legislation and guidelines underpin this.
Best wishes xx