php routing starts working if the resource specified in the url does not exist.
For url example.com/products.txt
the server will first look for the public/products.txt file, and if the file is not found, the server will pass control to the framework's routing.
For url example.com/products/show/1
first, the server will look for the file public/products/show/1, and if the file is not found, the server will pass control to the framework's routing.
If you get a 404 for /products/show/1, then there is no "public/products/show/1" file, or there is no "ProductsController" controller, or there is no "show" method in this controller, or this method returns 404.
Or your web server is not configured.