Decoding magnetic field-ionosphere relation in Mars can help future space missions