On most (all?) cameras I have seen, the directories are numbered starting at 100, and the files are numbered 0000-9999 in each folder for up to 10,000 images in each folder.
One logical reason I can think of to split files like this is to avoid running into filesystem limits with the maximum number of files per directory. For FAT32, which most modern cameras use, there is a limit of 65,534 files per directory. By limiting to 10,000 images per directory, that means a maximum of (in most cases) 20,000 files per directory (if shooting in RAW+JPEG mode), which is well under the 65k limit.
Of course most memory cards will fill up with far fewer than 65k images (unless perhaps shooting with a very low quality).
The other reason I know of is simply for convenience sake. Numbering the directories and the files gives you an easy way to tell how many images you've taken.
Now, when you start swapping memory cards between cameras (or even in the same one) you often throw off the camera's internal counter, and it gets confused about where images should go.
Suppose you have two cards, one who's last image was stored as 101/5000, then you put in a new card which contains an image called 104/2000, the camera will (in my experience, although this is likely vendor/firmware specific) jump to 104/2001 for the next image. Then when you put the first card back in, the camera may not jump back to 101/5001, but may continue with 104/2002, thus leaving you with an apparent gap in your photo numbers.