If I may toot my (somewhat) own horn for a moment, I'm extremely pleased with the outreach that the officiary has done to tournament organizers about bye allocation in recent years.
As Rosh pointed out, the most obvious system for bye allocation is to simply allocate byes to the latest/last waves which aren't completely filled (most organizers are, understandably, loath to hold the start of competition until registration has completely closed... so modern tournaments rarely know their exact final numbers until they are well underway. Even "sold out" events often have a certain number of no-shows, or some minor amount of "door registration flux" to deal with).
Let's take a hypothetical situation - a field of 64 competitors, where 1/4th of the players advance from the first round (as in the World Championships) but then it's direct elimination from the round of 16 onward.
In a full field for the above scenario, a player should have to win 6 matches to win the tournament (two victories to move on from a round of 64, and then single victories in a round of 16, quarter, semi, and final match).
However, if only 50 players show up (and the tournament organizers don't start allocating bye's until, say, the final three "waves" of the first round - it's conceivable that the last players could only have to win 4 matches to win the tournament, a decided advantage over early entrants.
Aside from a basic fairness point of view (which gets even more unbalanced the larger the tournament and the greater the registration uncertainty), it's also troubling from a logistics point of view when the optimal strategy becomes to show up at the venue as late as possible.
The Grand Marshall's office of the society (who rarely get credit here for the good work they do backing up the referee's at major WRPS events) have made real inroads in developing a new system of random bye allocation for the World Championships where bye's are only accredited in advanced rounds where players have all won the same amount of times to advance.
While this is significantly more tricky for event organizers to calculate "on the fly" by having byes randomly distributed in rounds where players have all won the same number of matches to get there - it at most allows a one match advantage, and no advantage to "metagaming" the tournament through placement.
Let's look at our hypothetical situation:
Round 1 (50)
Given our registration of "50" we would field Six full fields of 8 Players. Since there is no way to group the last two registering players in such a way that they must win two matches to advance, they are either cancelled and refunded (giving an incentive to actually show up early), or a tournament can have three "proposition players" on stand-by to fill the field (as is common in casinos to make up poker tables).
A digression - The most players that would ever be "cancelled" (or proposition players required) is 3... as if you have a group of 4, you can advance one person from a field of 4 with two victories. Therefore there is no registration number that through either adding (or subtracting) three players you can't end up with a competitively equal field. In a direct elimination system this gets even simpler, as you only need 1 "cancel" (or proposition player) to ensure an equal opening round.
For the purpose of this example, let's add two proposition players to the field, allowing us to advance 13 players (each player having to win two matches to advance from their opening-round pool).
Since there is no way to advance an odd number of people - this is then the round where we must add bye's by randomly distributing 3 bye's amongst the advanced round. Provided the second round seeding was distributed randomly (as it should have been) there is no player in the entire first round who is more, or less, likely to be awarded a bye... and no way that the same player has a chance at more than one bye. Inserting three byes into this round gives us the equivalent of 16 participant, and the remaining rounds advance cleanly.
As a general practice (the limits of which I'll explain below) there is merit in the practise of awarding as *few* bye's as possible in earlier rounds, in favour of one or two in later rounds. While this seems counter-intuitive (later rounds seeming like they should be "worth" more) it's important to realize that having one bye in a round of 32 is effectively the same as having 16 byes in a round of 512... and the fewer the overall byes awarded, the less chance that they will have an obvious effect on the tournament outcome.
But there is a limit to this suggestion - going back to our example field, let's take a situation where we "cancel" the two last players to arrive, ending up with only 6 full fields of 8 players. Under this scenario. 12 could advance to the round of "16", 6 could advance to the round of "8", and 3 could advance to the quarter finals. One random bye in this round actually would solve the bye imbalance, meaning only one player out of 50 will be affected by a bye and all players have a more or less equal chance at getting that bye.
Now what the clever math types amongst you will have realized is that the above scenario reduces the total number of byes needed (which is obviously a good thing)... it's obviously exponentially increased the chance that the finals will be influenced by a player who has received a bye (in our example to 100%) and, therefore, the (perceptible) outcome of the tournament will be tainted.
Each specific tournament will require a different balance, but a good starting rule of thumb is that byes should try to be all awarded no later than the 1/4th equivalent of a tournament. Therefore in a tournament of 16-ish you should allocate all bye's by your round of 4, or by your round of 64 in a tournament of ~256. This will at least strike a bit of a balance between limiting the total number of byes, and also the perception of the value of said byes as there's a good chance that, even in a quarter field, a limited number of random byes will be eliminated by the finals.
There is always a certain amount of "secret sauce" needed in bye allocation - which mostly boils down to how randomly advanced rounds are seeded. Yes, it remains true that an unscrupulous promoter could try and influence byes toward waves where they knew (or suspected) that individuals favourable to them would be competing... but the same could be said of rigging the pools themselves.
The most important issues to address in bye allocation is to limit the ability for players to use "metagaming" (or intentionally manipulating the tournament's structure) to gain a competitive advantage - and also to limit the perception that "byes" are intrinsically important to who ends up in the final rounds.