Jacob is fleeing Canaan at his mother's insistence because his brother Esau intends to kill him. Jacob incurred his brother's wrath because he stole not only Esau's birthright but his father Isaac's blessing. As Jacob flees toward Haran (where his parents want him to take a wife) he stops overnight along the way because the sun has set. He takes a stone for a pillow and falls asleep.
"Then he dreamed, and behold, a ladder was set up on the earth, and its top reached to heaven; and there the angels of God were ascending and descending on it. And behold, the Lord stood above it and said: 'I am the Lord God of Abraham your father and the God of Isaac; the land on which you lie I will give to you and your descendants. Also your descendants shall be as the dust of the earth; you shall spread abroad to the west and the east, to the north and the south; and in you and in your seed all the families of the earth shall be blessed. Behold, I am with you and will keep you wherever you go, and will bring you back to this land; for I will not leave you until I have done what I have spoken to you.' Then Jacob awoke from his sleep and said; 'surely the Lord is in this place, and I did not know it.'" (Genesis 28:12-16)
The ladder represents the gateway between heaven and earth. This is a portal through which angels ascend and descend as they carry out God's assignments upon the earth. The Lord is standing above the ladder meaning that he has made this spot a place of special habitation. Jacob rightly understands that in this place he has direct access to God. When Jacob awakens he is in awe and understands the place where he has slept is literally "Bethel" or "house of God" and he so names it.
Jacob thought he was simply sleeping in the most convenient place along his journey but God prepared this spot and his dream so that he could speak to Jacob and confirm the covenant he made with Abraham. This is a watershed moment for Jacob because it is the time when he finally enters into his own personal relationship with God. He is no longer operating on his father or grandfather's spiritual coattails. God is sovereign and he is also faithful in his reminder to Jacob that because of Abraham, Jacob will be blessed and he will eventually return to the land he is now leaving.
See more articles on dreams