Let's say that 'a' is some positive number. Let's pick a = 5.
That means |x| = a turns into |x| = 5
The equation |x| = 5 solves to x = -5 or x = 5.
This is because the values -5 and 5 on the number line are exactly five units away from zero.
In short, a = 5 leads to |x| = a having the two solutions x = -5 or x = 5.
-------------------
Keeping the same value of 'a', the equation |x| = -a turns into |x| = -5
What number on the number line is exactly negative 5 units away from zero? The answer is "no such number exists". Distance is never negative.
Therefore, |x| = -5 has no solutions.
--------------------
So if a = 5, then the first equation |x| = a has two solutions, while |x| = -a has no solutions.
If we made 'a' to be some negative number, then things would flip around. In this case, it would mean |x| = a has no solutions while |x| = -a has two solutions.
The only time both equations would have a solution is when a = 0
We can see that |x| = a becomes |x| = 0, and |x| = -a becomes |x| = -0 or just |x| = 0 which is the exact same thing the first equation turned into. We're dealing with the same equation at this point.
--------------------
If your teacher states "The value of 'a' is nonzero", then the two equations do not have the same solution set. If a = 0, then it leads to x = 0 as the only solution for both equations.