<u>Answer:</u> This is so because, they have same number of valence electrons.
<u>Explanation:</u>
In a periodic table, elements are arranged in 18 vertical columns known as groups and 7 horizontal rows known as periods.
Elements arranged in a group show similar chemical properties because of the presence of same number of valence electrons.
We are given:
Magnesium is the 12th element of the periodic table having electronic configuration 
It has 2 valence electrons.
Calcium is the 20th element of the periodic table having electronic configuration 
It has 2 valence electrons.
Hence, this is so because, they have same number of valence electrons.