How page with random php file with query params generated

The site you linked isn’t a WordPress.

You can make custom WordPress URL’s using WordPress’s URL Rewrite API. See https://codex.wordpress.org/Rewrite_API/add_rewrite_rule#Example , e.g.:

function custom_rewrite_basic() {
  add_rewrite_rule('^anythinghere/([0-9]+)/?', 'index.php?page_id=$matches[1]', 'top');
}
add_action('init', 'custom_rewrite_basic');

This makes a new URL format like yoursite.com/anythinghere/95

If that doesn’t meet your needs you can also edit .htaccess

Editing your question to include a specific example of a URL you’d like to make and where it should go in regular WordPress URL’s will allow a more specific answer. For example, your question could include a format of a URL you want: e.g.: yoursite.com/foo/bar/hello.php?id=1234567 and a description of where you want the URL to go: “I want this URL to go to post ID 1234567”