How do miners select which transactions to include in a block?
A bitcoin node's (bitcoin's standard client acts as one) first function is to relay transactions on a best effort basis, it only relays valid transaction. The miner which also is a node will try to solve a block on the transaction it received, but in the end the miner has last word he can decide to arbitrarily discard some transaction (like one with no miner's fee)