Is there a logic to the way The LEGO Group fills the plastic bags? When opening a new box, most of the pieces are in closed plastic bags, and sometimes inside those plastic bags is another plastic bag for smaller pieces.

I find the pieces, for the most part, rather random.  Sometimes a particular brick shows up in more than one bag.

It seems like an odd way to make sure all of the pieces are there in the box, and yet, a box is rarely, if ever, missing a brick.

Any rhyme or reason to how Lego packages the pieces for a new set?
The main goal is certainly packaging efficiency (possibly where parts come from in the factory, for example), but there are other factors coming in.

Sets which have "modular" building need to have numbered bags, and the numbering has prioity on other considerations — you'll need all bricks for module 1 to be in bags numbered "1" (plus sometimes, unbagged parts).

Also, elements which are too similar are usually in different bags. This helps finding them when building, but another reason for that might be the random checks which are done on bag contents during the packaging process, as I believe these are manual.

Sometimes, if an element is in huge quantity in a set, it can also get its own bag; and as jfyelle says, sometimes a same bag can appear twice in a set — it's easier for packaging than two bags with different contents.