Throwing your hat in the ring means entering a political contest. This expression came from the boxing ring. Anyone who wanted to challenge a boxer would throw his hat into the ring. This would cause the crowd to make a lot of noise trying to encourage the challenger. This challenger would push himself through the crowd and would go into the ring.
In the early 1900's John Hamilton Reynolds made use of this expression, " Throw in his hat, and with a spring get gallantry within the ring".