The tag makes sure a new paragraph is created, because the HTML specification (constructed by the W3C) says so:
HTML5 (w3.org)[
^]. Specific part:
4.4.1 The p element — HTML5[
^].
The tag doesn't actually "know what to do", because HTML is just a markup language and doesn't "know" anything by itself. However, your
web browser does know what
<p>
means, because browsers follow the HTML spec that I linked. So your browser renders it as a new paragraph.