Answer: Because nickel is a transition metal.
Step-by-step explanation:
We are given two compounds named as magnesium nitrate
and Nickel (II) nitrate

Both the compounds are ionic compounds and its naming is done as follows:
- Positive is written first.
- The negative ion is written next and a suffix is added at the end of the negative ion. The suffix written is '-ide'.
- If the metal ion is a transition metal, then the oxidation state is written in roman numerals inside the bracket. This is so done because transition metals show variable oxidation states.
Hence,
is written as magnesium nitrate and
is written as Nickel (II) nitrate due to variable oxidation state shown by transition metals.