Beginner Question Here: I am very new to fullstack development, and have been looking around at various beginner tutorials. One thing I do not really understand is how the backend and frontend "verify" that they are talking to each other. For example, if in a tutorial someone hosts the backend/api on Heroku, and the frontend on Netlify, how does the backend know that the get/post/put/delete request it is getting is actually coming from the legitimate frontend - and not some 3rd party who has tapped into it.
In the tutorials I am referencing the frontend is always told the URL of the backend API, but it never seems the backend is told where the frontend is, and where the requests will be coming from. I know this isn't the case, but it seems to me that anyone could just execute frontend code which triggers the backend into deleting/editing contents from the connected database.
If it would be easier to explain to me how this concept works, with an actual code-base you can reference - I'll link a tutorial I am slightly confused about below.
Tutorial: https://www.youtube.com/watch?v=aibtHnbeuio
Code from Tutorial: https://github.com/adrianhajdin/project_mern_memories
Any explanations would be of great help. Thanks in advance