Why is Kundali matching necessary before marriage?

The horoscope is the birth chart of every person. It reflects the life journey of a person. And this will help guide you and work on your life. Kundli especially helps in the marriage of every person. Kundli has great importance in Hindu tradition, which helps you create meaning in life. It is said that while getting married, it is important to first try to match the horoscopes, this reveals the position of the planets between two people. How will this work in their marriage? What will be the ups and downs in all these things which help in horoscope matching?