A small blog at blog.example lets readers leave comments. The server pulls comments from its database and builds one page of HTML. Some of that page is plain text for people to read, and some is code that the browser must run.
The browser cannot tell where the text came from. It sees one stream of characters and obeys whatever looks like code. So everything depends on the server keeping the two apart: a comment must always arrive as text, never as something to execute.
💡Good to know
Cross-site scripting (XSS) is what happens when that separation breaks.