The short version is that the front end runs on the visitor's computer and the back end runs on yours.
That one distinction, where the code is actually executing, explains almost everything else about the split.
The front end.
When you visit a site, your browser downloads files and runs them on your machine. Those files are HTML for the structure, CSS for how it looks, and JavaScript for how it behaves when you click and type.
You can see all of it. Right click any page and choose View Source or Inspect, and you are looking at that site's front end. Nothing there is hidden, because it had to be sent to you for your browser to run it.
The back end.
The back end runs on a server somewhere else. It handles the database, accounts and passwords, payments, and anything that has to be decided somewhere the visitor cannot reach. It is written in something like Python, Java, C#, PHP or Node, and the visitor never sees that code, only the results it sends back.
Why the line sits exactly there.
This is the part worth understanding, because it is not an arbitrary division of labor.
Anything sent to the browser can be read and changed by the user. So if you wrote a login check in JavaScript, someone could open the developer tools, read your logic and walk straight past it. That is why passwords are checked on the server. Same with prices. A shop that calculated totals in the browser could be tricked into charging a penny.
So the rule is that the front end decides how things look and feel, and the back end decides anything that must be true. Presentation in front, trust in back.
The same action, split across both.
Logging in is a good example to trace all the way through.
The front end draws the form, checks you did not leave a field blank, and sends what you typed.
The back end looks up the account, compares the password, and replies yes or no.
The front end then shows you your dashboard or an error message.
Notice the front end did a blank field check too. That is for convenience, giving you instant feedback without a round trip. The back end checks everything again anyway, because it cannot trust anything that arrived from a browser.
If you are deciding which to learn first, front end is usually the easier start, mostly because you see results immediately. You write HTML and CSS, refresh, and the change is right there on screen, which makes the feedback loop very short while you are learning.