"Pride comes before the fall" means that someone who is overconfident is likely to experience an event that shows the pride to be unjustified. The person with too much pride will "fall" from the position of overconfidence.
The source of the phrase "pride comes before the fall" is the Bible, specifically Proverbs 16:18, which reads, "Pride goes before destruction, a haughty spirit before a fall" in the New International Version. Some Bible scholars understand this verse to mean that God will discipline pride by causing or allowing events to produce humility in a person, while others simply note that pride produces carelessness that can lead to serious errors. Whichever belief a person holds, someone who says "pride comes before the fall" usually means it as a warning that someone thinks too highly of himself or herself, and that the person in question will soon experience negative consequences because of this overconfidence.
History is full of examples when this adage has played out. In the Titanic disaster, a ship declared indestructible by its proud makers sank on its maiden voyage. Several famous battles are said to have ended in defeat because military leaders' overconfidence caused them attempt foolhardy attacks. Business leaders have made unethical and illegal decisions, thinking they will not be caught, only to lose their jobs or land in prison. In these cases and countless others, pride went before destruction and a haughty spirit before a fall.