When a league is first created, or if it is realigned (this happens in free leagues when new teams are added or in Premium leagues when the Commish requests it), it must be aligned into conferences and divisions.
Here's how alignment works:
First, the league is split into conferences. Basically, looking in this order, the first half of the teams in the league that match this list go to the National Conference, the rest to the American Conference. For 32-team leagues, some cities (those in Tier 0 or Tier 1) have division preferences, listed here:
So in a 32-team league, the top 16 teams on this list are guaranteed to be National Conference, the bottom 16 are guaranteed to be American Conference, and the ones in the middle will go either way depending on how the list fills up. But if an owner wants to guarantee being in one conference or the other, they can do that by picking one of the top 16 or bottom 16 cities.
Next, divisions are picked. Imagine each division having a "team captain" picking team members on a schoolyard. The American Conference goes first, and picks its teams round-robin: West then East for leagues split into two divisions per conference (12, 16 and 20 team leagues), West, Central and East for leagues split into three divisions per conference (18, 24 and 30 team leagues), and West, then East, then North, then South for leagues split into four divisions per conference (32 team leagues). It asks the database for the next team that fits the following criteria:
So let's say the AFC consists of NYA, TEN, SD, MIA, PIT, NE, BUF, CLE, PHX, SJ, SYR, ORL, LV, SAS, POR, and TUL. West picks first; SD has a preference so it goes to West. East picks next; there are four teams with preference for East but NE is farthest east so that's where it goes. North picks next. PIT and CLE both have preferences for North, but CLE is farther north so it is assigned to North. South picks next; TEN has a preference for South so off it goes.
Next round: West goes; no teams left with a preference so it gets POR. East still has a preference so it gets NYA. North gets PIT, South has no teams with a preference for South so it picks a team without a preference, the farthest south is ORL.
Next round: West takes SJ. East gets its next preference, BUF. North is out of teams with a preference and takes SAS. South takes the next southernmost team, PHX.
Final round: West gets LV, and East gets its final preference, MIA. North gets SYR, South gets TUL.
So if the teams at the offseason are the same as they are now, the AFC will be:
West: SD, POR, SJ, LV East: NE, NYA, BUF, MIA North: CLE, PIT, SAS, SYR South: TEN, ORL, PHX, TUL
Occasionally, this will result in oddball choices. For example, if BAL were in this hypothetical conference rather than LV, SYR (Syracuse) would have ended up in the American Conference West even though it is in no way "west", because its more logical divisions (East and North) were filled up mostly by teams with a built-in division preference. Again, please note that these division preferences are only used for 32-team leagues.