One thing that can be used for is to force the browser to re-pull scripts or stylesheets, by changing the query string. That way, in case the file ever changes, and the site wants to force any users to pull the new one instead of using a cached copy, they just change the query string.
For example:
<script src="//whatever.com/something.js"></script>
If you have this on your page, then a browser will pull it down once, then probably cache it for awhile, so every time your page loads, they'll use the cached copy unless they have a reason to try to re-pull (like F5-refreshing the page).
If you use a random query string, then once you change your query string in your markup, the browser has to go pull a new one, since the browser thinks it's a new file (regardless of whether or not it actually is). And the content server will ignore the query string parameters on static files, so it doesn't care what you put:
<script src="//whatever.com/something.js?v=12345"></script>
The browser will grab the file again, whether it needs it or not.
<script src="//whatever.com/something.js?v=98765"></script>
Now it will do it again.