Well, the same way the ASP page would do it (that's assuming the ASP page does it at all).
Depending on where you saw it, chances are it was all being done in Javascript (I'm not going to show code for it, because (a), there's plenty of examples out there already, (b) one of them is the page where you saw it, and (c) I'm not keen on coding Javascript.) Here's how you can tell: did you sit around waiting for the second combo box to be updated every time you changed the value of the first? Or did it update straight away. If it updated straight away it's a pure Javascript thing, and the only work ASP or PHP did or would do would be to write out all the Javascript code that says what goes in the second combo box when.
Otherwise, if the ASP/PHP page has to update the whole page, then the onChange handler would have to submit a form. Not the same one that contains the combo boxes, another one.
It's just a wee form that contains only a hidden field. Its action is the same page that the form appears on (so that it has the effect of a page refresh).
What the onChange handler does is sets that hidden field to the current value of the combo box it's monitoring, and then calls the wee form's submit method. PHP receives the submission, and now it knows what the current value of the combo box is, and can figure out what to write in the second combo box when it refreshes the page (which is its main job).
A separate form is used so that there is no confusion about which is a "real" form submission and which is just a combo box update.