in most cases, the script gets the (e.g.) ?id_article=59 and loads the article/product data directly from a database ...
$sql = "select title,text,author from article where id=$id_article";
(database selection code skipped)
then, it takes the template and replaces, for example, the keywords <!TITLE>, <!TEXT>, <!AUTHOR> marks with the info previously selected from the database. now it spits out the completed page.
if you don't use a database, you can handle this with, say, textfiles, too ... as far as the desired content can be identified by the id_article.