you use this to pass variables to a script. This is used for a number of reasons, usually having to do with dynamic content.
In php, the query line (stuff after the "?") variables are accessed using the $_GET superglobal array.
In your example
?do=newthread&f=2
$GET['do'] = 'newthread'
$GET['f'] = 2
read up on superglobals ($GET, $POST, $_SERVER) and look at any examples you can find