Aswamedha yajna was a royal rite. It was done only by the Kings to spread their glory throughout the world and for the benefit of their kingdom (rāṣṭram vā aśvamedhaḥ). Regarding its origin and usage of horses the Brihadaranyaka Upanishad says:
He (the first purusha or Brahman) desired "let this (his body) be fit for sacrifice(medha) and let me be embodied by
it". Then he became a horse as it swelled. He thought, it has become
fit for sacrifice. Hence, the horse sacrifice is called as Aswamedha.
The sacrifice itself has been mentioned in the Vedas (taitariya samhita, 7th khanda). So its origin is prehistoric. From scriptures like Ramayan (Bal Kanda) Mahavarat (Aswamedha Parva), etc. their performance and processes are known.
It was also beleived that one who performs 100 Asvamedha yanjas obtains the position of Indra in heaven. So Indra tries to create hindrances in such performances. One example is the Indra's stealing of King Pṛthu's horse on his final horse sacrifice. Also, Bali, grandson of Prahlad, tried to perform 100 Aswamedha yanjas after which he would have been the king of gods. So Lord Vishnu in the Vaman incarnation hindered his completion of 100 Aswamedha yanjas by taking away everything from him.
Ashwamedha Yajna was done to empower your kingdom and glory, so the ashwa(Horse) was Sacrafice(send Free to go anywhere). And what so ever the land the Horse was going to cover would be considered as a Integral part of the Kingdom of the person/King who had performed the ritual of Ashwamedha Yajna(Yudhisther and Pariksheet had done for the said cause). If any king/person will stop the horse or refuse to accept the kingship of the King(who performed the Ashwamedha yajna) need to fight for that(Just like Luv-Kush fought against the army of Lord Rama).
It was considered if anyone does 100 Ashwamedha Yajna, he would be considered as Indra, as Indra was the King of Gods,and was the king of entire Swarga. Hence if anyone will perform the Ashwamedh yajna 100 time will naturally cover all the earth, and hence will be considered as Indra, as he would be the only King of the Kings on the Earth.
Ashwamedha Yajna was also done if anyone thinks he had committed any big Mistake or sin in his life and now want to do the Penanace for that(Lord Rama has done the Ashwamedha yajna to do the Penance for killing a women(Strihattya of Tarka) and a Bramhmin()Bramhahatya of Ravana).
Like any library, Hinduism Stack Exchange shares great information, but does not offer personalized advice, and does not take the place of seeking such advice from any Acharya, Pundit, astrologer, Guru or other trustworthy Counselor.