I should find some reference material for this, but I'm too lazy.
My understanding is that in the past the parties chose their own candidates without the help of the state governments. This generally meant that a few powerful members of the party -- the elite or rich -- chose their candidate in what was seen by the public as secret, corrupt "smoke-filled rooms". Especially in a two-party system, this bothered the voting public, so reforms were passed to help make sure there was a fair and open system for the parties' to choose their candidates.