Ishmael was Abraham’s firstborn because of Sarai’s impatience.
Genesis 16:1-3 Now Sarai Abram’s wife bare him no children: and she had an handmaid, an Egyptian, whose name was Hagar. 2 And Sarai said unto Abram, Behold now, the LORD hath restrained me from bearing: I pray thee, go in unto my maid; it may be that I may obtain children by her. And Abram hearkened to the voice of Sarai. 3 And Sarai Abram’s wife took Hagar her maid the Egyptian, after Abram had dwelt ten years in the land of Canaan, and gave her to her husband Abram to be his wife.
This was not a good idea on Sarai’s part. God had promised Abraham a son and what was required was faith and patience on his and Sarai’s part. Sarai soon realised that her plan was a mistake.
Genesis 16:4-12 And he went in unto Hagar, and she conceived: and when she saw that she had conceived, her mistress was despised in her eyes. 5 And Sarai said unto Abram, My wrong be upon thee: I have given my maid into thy bosom; and when she saw that she had conceived, I was despised in her eyes: the LORD judge between me and thee. 6 But Abram said unto Sarai, Behold, thy maid is in thy hand; do to her as it pleaseth thee. And when Sarai dealt hardly with her, she fled from her face. 7 And the angel of the LORD found her by a fountain of water in the wilderness, by the fountain in the way to Shur. 8 And he said, Hagar, Sarai’s maid, whence camest thou? and whither wilt thou go? And she said, I flee from the face of my mistress Sarai. 9 And the angel of the LORD said unto her, Return to thy mistress, and submit thyself under her hands. 10 And the angel of the LORD said unto her, I will multiply thy seed exceedingly, that it shall not be numbered for multitude. 11 And the angel of the LORD said unto her, Behold, thou art with child, and shalt bear a son, and shalt call his name Ishmael; because the LORD hath heard thy affliction. 12 And he will be a wild man; his hand will be against every man, and every man’s hand against him; and he shall dwell in the presence of all his brethren.
The angel foretold the character of Ishmael and his descendants.
The promised son Isaac was born to Sarai miraculously when she was 90.
Things came to a head when Isaac was weaned
Genesis 21:1-13 And the LORD visited Sarah as he had said, and the LORD did unto Sarah as he had spoken. 2 For Sarah conceived, and bare Abraham a son in his old age, at the set time of which God had spoken to him. 3 And Abraham called the name of his son that was born unto him, whom Sarah bare to him, Isaac. 4 And Abraham circumcised his son Isaac being eight days old, as God had commanded him. 5 And Abraham was an hundred years old, when his son Isaac was born unto him. 6 And Sarah said, God hath made me to laugh, so that all that hear will laugh with me. 7 And she said, Who would have said unto Abraham, that Sarah should have given children suck? for I have born him a son in his old age. 8 And the child grew, and was weaned: and Abraham made a great feast the same day that Isaac was weaned. 9 And Sarah saw the son of Hagar the Egyptian, which she had born unto Abraham, mocking. 10 Wherefore she said unto Abraham, Cast out this bondwoman and her son: for the son of this bondwoman shall not be heir with my son, even with Isaac. 11 And the thing was very grievous in Abraham’s sight because of his son. 12 And God said unto Abraham, Let it not be grievous in thy sight because of the lad, and because of thy bondwoman; in all that Sarah hath said unto thee, hearken unto her voice; for in Isaac shall thy seed be called. 13 And also of the son of the bondwoman will I make a nation, because he is thy seed.
Isaac was the son who would inherit the promises and Ishmael and his mother were sent away.
Genesis 21:14-21 14 And Abraham rose up early in the morning, and took bread, and a bottle of water, and gave it unto Hagar, putting it on her shoulder, and the child, and sent her away: and she departed, and wandered in the wilderness of Beersheba. 15 And the water was spent in the bottle, and she cast the child under one of the shrubs. 16 And she went, and sat her down over against him a good way off, as it were a bowshot: for she said, Let me not see the death of the child. And she sat over against him, and lift up her voice, and wept. 17 And God heard the voice of the lad; and the angel of God called to Hagar out of heaven, and said unto her, What aileth thee, Hagar? fear not; for God hath heard the voice of the lad where he is. 18 Arise, lift up the lad, and hold him in thine hand; for I will make him a great nation. 19 And God opened her eyes, and she saw a well of water; and she went, and filled the bottle with water, and gave the lad drink. 20 And God was with the lad; and he grew, and dwelt in the wilderness, and became an archer. 21 And he dwelt in the wilderness of Paran: and his mother took him a wife out of the land of Egypt.
Isaac begat Jacob through whom came the Israelites.
From Ishmael came a separate people called Ishmaelites.
Psalms 83:6 The tabernacles of Edom, and the Ishmaelites; of Moab, and the Hagarenes;
In one sense, everything that God permits can be said to be the will of God, but the birth of Ishmael was in reality through the impatience of Sarai who couldn’t wait for God to fulfil his promise of a seed through her.