There is a specific UI guideline for something that can be enabled or not: it's called a tick box. The on-off switch thing is a distinctly iOS invention [1]. The funny thing is that OS X (now macOS) mostly held off using those 'switches' too, until fairly recently.
Whose specific UI guideline are you talking about? Android's recommends the switch component for setting toggles: https://m3.material.io/components/switch/overview
The switch widget is for settings where flipping the switch takes immediate effect, unlike a checkbox where you have to press some "OK", "Submit" or "Apply" button. In Windows 2000/Office UIs, this would've been shown as a button that could visibly switch between "pressed" and "not pressed" states, just like a push-down switch, but that was rarely used. The modern labeled switch design is a lot more intuitive than that.