Probably in the order it finds them, a selector pretty much traverses the DOM and when it finds an element that matches, puts it in an array.
You could maybe do a test by having say 5 textboxes with id's of "textbox_n" where n is a number, then alert the list and see what you get?