Stack Snippets were introduced on September 16, 2014 via a Stack Exchange blog post. They are an onsite alternative to external sources like JSFiddle and are meant to encourage users to provide a Minimal, Complete, and Verifiable example along with pertinent questions.
Stack Snippets are only available on some sites of the network, see: On what sites are Stack Snippets enabled?
Security is a major concern, and one measure that has been taken to combat potentially malicious snippets is the location of the hosting for the snippets: they are hosted on an external domain to prevent malicious snippets from modifying the page or account of the user running the code.
Stack Snippets can be tested in the Sandbox.