The web works because of open standards. The W3C (World Wide Web Consortium) publishes the specs for HTML (HyperText Markup Language) semantics, CSS (Cascading Style Sheets), SVG (Scalable Vector Graphics), and the accessibility guidelines that assistive technology depends on. The WHATWG (Web Hypertext Application Technology Working Group) maintains the HTML and DOM (Document Object Model) specs that browsers actually implement. Accessibility is baked into these standards. It's not a layer added on top.
The key accessibility standards are WCAG (Web Content Accessibility Guidelines) (what your content needs to do), WAI-ARIA (Web Accessibility Initiative — Accessible Rich Internet Applications) (semantics for custom widgets), ATAG (Authoring Tool Accessibility Guidelines) (for authoring tools, often overlooked), and UAAG (User Agent Accessibility Guidelines) (for browsers). WCAG is referenced in law in many countries, including the UK's Public Sector Bodies Accessibility Regulations, the US Section 508, and the European Accessibility Act.
Using native HTML and following the standards is usually the easiest path to accessibility: the platform does a lot of the work for you. Reinventing controls, using frameworks that don't output accessible HTML, or building for one browser almost always means doing manually what the web already offered for free.