A covenant is very similar to a promise. A covenant can be conditional or unconditional. Another word for covenant is testament. The Old Testament is a history of the covenants by which God revealed, little by little, His character and His plans and purposes for mankind. This article goes into the subject in more detail: https://www.gotquestions.org/Old-Testament-theology.html
When the time was right, God made a covenant with his servant Abraham, a sworn promise to bless him. That blessing would not be fully realised till long after Abraham died. Abraham, while he believed the Lord his God (and that is why his faith was credited to him as righteousness), was human – a man who wanted assurance. So God provided that assurance.
Genesis 15:9-16 describes how God spoke to Abraham in his sleep, foretelling the slavery and ill-treatment of his descendants for four hundred years (at the hands of the Egyptians). Then the Lord God would punish the Egyptians and Abraham’s descendants would come out with great riches. The significant part is in Genesis 15:17-21 when the covenant was ratified (sealed) when a smoking brazier with a blazing torch passed between the pieces of the animal sacrifice that Abraham had made earlier.
We must remember that Abraham was getting on in years when God made that covenant with him and his wife was barren. How could all of the nations be blessed through Abraham’s offspring when his wife was long past the age of childbearing and they had no son?
Against all hope, Abraham in hope believed and so became the father of many nations, just as it had been said to him, “So shall your offspring be.” Without weakening in his faith, he faced the fact that his body was as good as dead – since he was about a hundred years old – and that Sarah’s womb was also dead. Yet he did not waver through unbelief regarding the promise of God, but was strengthened in his faith and gave glory to God, being fully persuaded that God had power to do what he had promised. This is why it was credited to him as righteousness. (Romans 4:18-22).
There is much more to this than the Old Testament covenant whereby Abraham and his descendants would be blessed. The Old Testament covenant pointed ahead in time to the New Testament covenant when Jesus, a descendant of Abraham, opened up the way for all nations of the earth to be blessed:
The words “it was credited to him” were written not for him alone, but also for us, to whom God will credit righteousness – for us who believe in him who raised Jesus our Lord from the dead. He was delivered over to death for our sins and was raised to life for our justification” (Romans 4:23-25).
The Old Covenant has served its purpose, and it has been replaced by “a better covenant” (Hebrews 7:22). The New Covenant, of which Jesus Christ is the mediator, “In fact the ministry Jesus has received is as superior to theirs as the covenant of which he is mediator is superior to the old one, since the new covenant is established on better promises” (Hebrews 8:6).
Why did God make a covenant with Abraham? To reveal His sovereign will and purposes for humanity whereby all the nations on earth would be blessed through the ultimate fulfilment that came in the life, death and resurrection of His Son, Christ Jesus.
Why did Abraham ask God how he could know he would possess the land promised to him? Abraham simply wanted assurance, which, under the circumstances, was not unreasonable. And God was gracious enough to give Abraham the assurance he asked for.
Regardless of how unfaithful people may be, God will never be unfaithful to His covenant promises. The resurrection of Christ Jesus is our assurance of the hope we have in God’s New Covenant promises (Hebrews 6:19-20).