I don't know if there's a single story to go with it, but my understanding is that any law that names a particular place (city or county) as a target for whatever bullshit the lege comes up with, then the law wouldn't be unconstitutional. So, what they do in the Capitol is write these regs in such a way that they do (or sometimes don't) apply to jurisdictions by specific population ranges.
So, for example, you'll get stuff like a law that forbids communities above 500,000 in population from having a local sales tax to support economic development projects, meaning cities like Houston, Dallas, San Antonio, Fort Worth, and Austin can't compete as effectively on certain big investment projects but all of their suburban competitors reap the tax base and jobs windfall.
Then, you'll have some bullshit like counties starting with the letter M with a population range of 35,000-40,000 and located on the Gulf of Mexico America are exempt from Texas Commission on Environmental Quality regulations regarding the disposal of nuclear waste.