PHP was initially designed as a simple templating language for HTML. Where you used to have static HTML:
<p>Hello, World!</p>
… you could replace part of it with a dynamically generated value:
<p>Hello, <?=$name?>!</p>
^^^^^^^^^^ ^^^^^ HTML
^^^^^^ PHP
Although it's a full-fledged language nowadays, it still maintains the same basic embedded language syntax.
The PHP interpreter does not really care if the outer language is HTML or anything else because it just ignores everything that's outside PHP tags. It reads the source file and prints it as-is, but when it finds an opening PHP tag it starts parsing and executing as PHP code whatever it finds inside the tag. So it's possible to use PHP as templating engine for anything: CSS, JavaScript, XML, plain text, binary files... Whatever. PHP doesn't need to know or care.
A text editor like VisualStudio Code faces a different situation because the surrounding language is relevant to programmer thus it's relevant to editor. If it only cared about PHP code, everything outside PHP tags would neither have syntax highlighting nor code intellisense—not cool.
In practice there're two issues with that:
Since probably 99% of the times we have PHP inside HTML most editors just assume the outer language in a .php file is HTML and call it a day.
Now, why does my entry for <?php ?> in my php.json snippet file not work at all (but works when in html.json) when it's clearly a PHP tag (and clearly not an HTML tag)?
Because when you trigger the snippet you are in HTML context. Your caret is here:
<p>Hello, |</p>
… so VSCode searches in HTML snippets.
If your caret was e.g. here:
<p>Hello, <?=|?>!</p>
… it should work flawlessly because you're in PHP context thus VSCode searches in PHP snippets (try it!). But that's a pointless feature because you don't want to insert PHP tags when you're already in PHP mode—that generates invalid PHP because you cannot nest PHP tags.
<?phpwhen already in PHP context. It only makes sense outside. VSCode embedded languages support is not particularly sophisticated and it'll just assume HTML.