All materials enter or exit the cell nucleus through nuclear pore complexes (NPCs), efficient transport devices that combine high selectivity and throughput. NPC-associated proteins containing phenylalanine-glycine repeats (FG nups) have large, flexible, unstructured proteinaceous regions, and line the NPC. A central feature of NPC-mediated transport is the binding of cargo-carrying soluble transport factors to the unstructured regions of FG nups. Here, we model the dynamics of nucleocytoplasmic transport as diffusion in an effective potential resulting from the interaction of the transport factors with the flexible FG nups, using a minimal number of assumptions consistent with the most well-established structural and functional properties of NPC transport. We discuss how specific binding of transport factors to the FG nups facilitates transport, and how this binding and competition between transport factors and other macromolecules for binding sites and space inside the NPC accounts for the high selectivity of transport. We also account for why transport is relatively insensitive to changes in the number and distribution of FG nups in the NPC, providing an explanation for recent experiments where up to half the total mass of the FG nups has been deleted without abolishing transport. Our results suggest strategies for the creation of artificial nanomolecular sorting devices.