It's combination of things. Nowadays, almost everything is done at the group level: NBC buys Ellen for its O&Os, Tribune buys Celebrity Name Game for the stations it owns, etc. There are exceptions, especially when station groups each own stations in a given market. Beyond that, particularly with older shows, stations negotiate for shows directly with the syndication company that owns the rights. They probably pay more for exclusive rights.
I can't tell you the specifics on the Wheel of Fortune switch in 1985 (Jeopardy apparently moved at the same time), but chances are, the company that owned WLOS was willing to pay more than Pulitzer, who owned WYFF.
When stations get bought and sold, generally they keep the same syndicated shows 'til the end of the contract, but everything is negotiable.